package com.njcn.mq.message;

import com.njcn.middle.rocket.domain.BaseMessage;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 类的介绍：
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2023/8/11 15:06
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class AppAutoDataMessage 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{

        @ApiModelProperty("数据属性 1-Max 2-Min 3-Avg 4-Cp95")
        private Integer dataAttr;

        private Long dataTimeSec;

        private Integer dataTimeUSec;

        @ApiModelProperty("数据是否参与合格率统计")
        private Integer dataTag;

        private String data;
    }

}
