package com.cmvr.edge.client.utils;

import cmvr.api.Common;
import com.google.protobuf.Timestamp;

/**
 * 边缘系统通用工具类
 */
public class EdgeCommonUtil {

    /**
     * 构建边缘系统请求头
     *
     * @param deviceId 设备ID
     * @return 边缘系统服务请求头对象
     */
    public static Common.CommandHeader.Request buildRequest(String deviceId) {
        return Common.CommandHeader.Request.newBuilder()
                .setDeviceId(deviceId)
                .setTimestamp(
                        Timestamp.newBuilder()
                                .setSeconds(System.currentTimeMillis() / 1000)
                                .build()
                )
                .build();
    }
}
