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

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

    @Schema(description = "管理地址")
    @ExcelProperty("管理地址")
    private String adminIp;

    @Schema(description = "管理账号", example = "芋艿")
    @ExcelProperty("管理账号")
    private String username;

    @Schema(description = "管理密码")
    @ExcelProperty("管理密码")
    private String password;

    @Schema(description = "网关名字", example = "赵六")
    @ExcelProperty("网关名字")
    private String gatewayName;

    @Schema(description = "备注", example = "随便")
    @ExcelProperty("备注")
    private String remark;

    @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("是否启用")
    private Boolean isEnable;

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

    @Schema(description = "网关编码")
    @ExcelProperty("网关编码")
    private String gatewayCode;

    @Schema(description = "网关状态", example = "1")
    @ExcelProperty(value = "网关状态", converter = DictConvert.class)
    @DictFormat("iot_gateway_status") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private String gatewayStatus;

    @Schema(description = "订阅主题")
    @ExcelProperty("订阅主题")
    private String topic;

}