package com.njcn.gather.aireport.testdevice.pojo.param;

import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;

public class TestDeviceParam {

    @Data
    @EqualsAndHashCode(callSuper = true)
    public static class QueryParam extends BaseParam {
        @ApiModelProperty("关键字，匹配设备型号名称或设备编号")
        private String keyword;

        @ApiModelProperty("创建开始时间，yyyy-MM-dd HH:mm:ss")
        private String searchBeginTime;

        @ApiModelProperty("创建结束时间，yyyy-MM-dd HH:mm:ss")
        private String searchEndTime;
    }

    @Data
    public static class AddParam {
        @ApiModelProperty("设备型号ID")
        @NotBlank(message = "设备型号不能为空")
        private String type;

        @ApiModelProperty("设备编号")
        @NotBlank(message = "设备编号不能为空")
        private String no;

        @ApiModelProperty("校准有效期，yyyy-MM-dd")
        @NotBlank(message = "校准有效期不能为空")
        private String validityPeriod;

        @ApiModelProperty("设备状态，01-在运，02-退运")
        private String state;
    }

    @Data
    public static class UpdateParam extends AddParam {
        @ApiModelProperty("检测设备ID")
        @NotBlank(message = "检测设备ID不能为空")
        private String id;
    }
}
