package com.njcn.mq.message;

import com.google.gson.annotations.SerializedName;
import com.njcn.middle.rocket.domain.BaseMessage;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * 类的介绍：
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2023/8/22 11:06
 */
@Data
public class AppEventMessage extends BaseMessage {

    @ApiModelProperty("网络设备码")
    private String id;

    private Integer mid;

    @ApiModelProperty("逻辑设备 治理逻辑设备为1 电能质量设备为2")
    private Integer did;

    private Integer pri;

    private Integer type;

    private Msg msg;

    @Data
    public static class Msg{

        @ApiModelProperty("逻辑子设备 治理逻辑设备为0 电能质量设备为1、2")
        private Integer clDid;

        private Integer dataType;

        @ApiModelProperty("数据属性：无-0、实时-1、统计-2")
        private Integer dataAttr;

        private Integer dsNameIdx;

        private List<DataArray> dataArray;
    }

    @Data
    public static class DataArray{

        private Integer idx;

        private String name;

        private Long dataTimeSec;

        private Long dataTimeUSec;

        @ApiModelProperty("事件类型")
        private String type;

        @ApiModelProperty("告警故障编码（一般显示为Hex）")
        private String code;

        private List<Param> param;
    }

    @Data
    public static class Param{

        private String name;

        private String type;

        private String unit;

        private Object data;
    }
}
