package cn.iocoder.yudao.module.iot.controller.admin.alertrecord.vo;

import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Schema(description = "管理后台 - 告警记录 Response VO")
@Data
@ExcelIgnoreUnannotated
public class AlertRecordRespVO {

    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31176")
    @ExcelProperty("ID")
    private Long id;

    @Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("编码")
    private String alertCode;

    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
    @ExcelProperty("名称")
    private String alertName;

    @Schema(description = "告警类型", example = "2")
    @ExcelProperty(value = "告警类型", converter = DictConvert.class)
    @DictFormat("iot_alert_type") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private String alertType;

    @Schema(description = "告警等级")
    @ExcelProperty(value = "告警等级", converter = DictConvert.class)
    @DictFormat("iot_alert_level") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private String alertLevel;

    @Schema(description = "告警内容")
    @ExcelProperty("告警内容")
    private String content;

    @Schema(description = "告警条件")
    @ExcelProperty("告警条件")
    private String conditionInfo;

    @Schema(description = "逻辑表达式")
    @ExcelProperty("逻辑表达式")
    private String conditionFormula;

    @Schema(description = "数据值")
    @ExcelProperty("数据值")
    private String dataValue;

    @Schema(description = "数据类型", example = "1")
    @ExcelProperty(value = "数据类型", converter = DictConvert.class)
    @DictFormat("iot_device_data_type") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private String dataType;

    @Schema(description = "单位")
    @ExcelProperty("单位")
    private String dataUnit;

    @Schema(description = "描述", example = "你说的对")
    @ExcelProperty("描述")
    private String dataTypeRemark;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    @Schema(description = "告警ID", example = "16965")
    @ExcelProperty("告警ID")
    private Long alertId;

    @Schema(description = "告警音频")
    @ExcelProperty("告警音频")
    private String alertAudio;

    @Schema(description = "重复告警")
    @ExcelProperty(value = "重复告警", converter = DictConvert.class)
    @DictFormat("infra_boolean_string") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Boolean isRepeat;

    @Schema(description = "不重复间隔")
    @ExcelProperty("不重复间隔")
    private Long noRepeatDuration;

    @Schema(description = "来源ID", example = "19268")
    @ExcelProperty("来源ID")
    private Long dataId;

    @Schema(description = "来源编码")
    @ExcelProperty("来源编码")
    private String dataCode;

    @Schema(description = "来源名称", example = "芋艿")
    @ExcelProperty("来源名称")
    private String dataName;

}