package cn.iocoder.yudao.module.iot.controller.admin.alert.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 AlertRespVO {

    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28840")
    @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 = "告警音频", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("告警音频")
    private String alertAudio;

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

    @Schema(description = "不重复间隔", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("不重复间隔")
    private Long noRepeatDuration;

    @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty(value = "是否启用", converter = DictConvert.class)
    @DictFormat("infra_boolean_string") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Boolean isEnable;

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

}