package com.mortals.xhx.common.pdu.device;

import com.alibaba.fastjson.JSON;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;


@Data
public class DeviceMsgReqPdu implements Serializable {
    /**
     * 设备编码
     */
    private String deviceCode;

    private String productCode;

    private Long siteid;

    /**
     * 消息类型
     */
    private String messageType;
    /**
     * 时间戳（毫秒）
     */
    private Long timestamp;
    /**
     * 消息内容
     */
    private String data;

    public static void main(String[] args) {
        ArrayList<DeviceMsgReqPdu> deq = new ArrayList<>();

        DeviceMsgReqPdu deviceMsgReq = new DeviceMsgReqPdu();
        deviceMsgReq.setDeviceCode("a1");
        deviceMsgReq.setMessageType("heart_beat");
        deviceMsgReq.setData("{xxxx}");
        deviceMsgReq.setTimestamp(new Date().getTime());

        deq.add(deviceMsgReq);

        deviceMsgReq = new DeviceMsgReqPdu();
        deviceMsgReq.setDeviceCode("a2");
        deviceMsgReq.setMessageType("heart_beat");
        deviceMsgReq.setData("{bbbbbb}");
        deviceMsgReq.setTimestamp(new Date().getTime());
        deq.add(deviceMsgReq);

        System.out.println(JSON.toJSONString(deq));

    }

}
