package com.njcn.csdevice.pojo.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author xy
 */
@Data
public class EachModuleVO implements Serializable {

    @ApiModelProperty("模块名称")
    private String moduleName;

    @ApiModelProperty("模块状态")
    private String moduleState;

    @ApiModelProperty("模块运行状态数据")
    List<HarmonicVo> dataList;

    @ApiModelProperty("负载电流数据")
    List<DataVo> loadList;

    @ApiModelProperty("模块输出电流")
    List<DataVo> modOutList;

    @ApiModelProperty("模块温度")
    List<DataVo> temperatureList;

    @Data
    public static class HarmonicVo implements Serializable {

        @ApiModelProperty("稳态数据时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime time;

        @ApiModelProperty("模块状态 0-离线，1-运行，2-停止，3-故障")
        private String stateDesc;

        @ApiModelProperty("数据类型 0-稳态数据 1-事件数据 2-主动触发")
        private Integer dataType;

        @ApiModelProperty("事件code")
        private String eventCode;

        @ApiModelProperty("事件名称")
        private String eventName;
    }

    @Data
    public static class DataVo implements Serializable {

        @ApiModelProperty("稳态数据时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime time;

        @ApiModelProperty("相别")
        private String phasicType;

        @ApiModelProperty("数据")
        private Double data;
    }
}
