package com.xy.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xy.utils.PageBean;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * <p>
 * 机器默认参数表
 * </p>
 *
 * @author lijin
 * @since 2025-06-30
 */
public class DeviceParamsConfigDto {

    @Data
    @Accessors(chain = true)
    public static class Query {

        @NotNull(message = "deviceId不能为空")
        @ApiModelProperty(value = "设备id", required = true)
        private Long deviceId;

    }

    @Data
    @Accessors(chain = true)
    public static class Page {

        @ApiModelProperty(value = "分页对象", required = true)
        private PageBean page;

        @ApiModelProperty(value = "商户id")
        private Long mercId;

        @ApiModelProperty(value = "设备id")
        private Long deviceId;

        @ApiModelProperty(value = "编码")
        private String code;

        @Data
        @Accessors(chain = true)
        public static class Vo extends DeviceParamsConfigDto.Vo {

            @ApiModelProperty(value = "商家名称")
            private String mercName;

        }
    }

    @Data
    @Accessors(chain = true)
    public static class Save {

        @ApiModelProperty(value = "商户id")
        private Long mercId;

        @ApiModelProperty(value = "设备id")
        private Long deviceId;

        @ApiModelProperty(value = "编码", required = true)
        private String code;

        @ApiModelProperty(value = "值", required = true)
        private String json;

    }

    @Data
    @Accessors(chain = true)
    public static class Vo {

        private Long id;

        @ApiModelProperty(value = "商户id")
        private Long mercId;

        @ApiModelProperty(value = "设备id")
        private Long deviceId;

        @ApiModelProperty(value = "编码")
        private String code;

        @ApiModelProperty(value = "值")
        private String json;

        @ApiModelProperty(value = "创建时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime createTime;


    }

}
