package com.sy.coinage.workshop.req;

import com.sy.coinage.core.interceptor.Create;
import com.sy.coinage.core.interceptor.Update;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Date;

import com.alibaba.fastjson2.annotation.JSONField;
import org.hibernate.validator.constraints.Range;
import lombok.Data;

/**
 * -添加/修改请求bean
 */
@Data
public class HumidityTemperatureReq implements Serializable {

    private static final long serialVersionUID = 1L;
    @NotNull(message = "主键不能为空", groups = {Update.class})
    @Range(min = 1, groups = {Update.class})
    private Integer id;

    @ApiModelProperty(value = "temperature", required = true)
    @NotNull(message = "temperature不能为空")
    private Double temperature;

    @ApiModelProperty(value = "humidity", required = true)
    @NotNull(message = "humidity不能为空")
    private Double humidity;

    @ApiModelProperty(value = "创建日期(yyyy-mm-dd)", required = true)
    @JSONField(format = "yyyy-MM-dd")
    @NotNull(message = "创建日期(yyyy-mm-dd)不能为空")
    private Date created;

    @ApiModelProperty(value = "汇报时间（hh:mm:ss）", required = true)
    @NotBlank(message = "汇报时间（hh:mm:ss）不能为空")
    @Length(max = 8, message = "汇报时间（hh:mm:ss）长度不正确,最大长度8字符")
    private String createTime;

    @ApiModelProperty(value = "设备上报时间(yyyy-mm-dd hh:mm:ss)", required = true)
    @JSONField(format = "yyyy-MM-dd")
    @NotNull(message = "设备上报时间(yyyy-mm-dd hh:mm:ss)不能为空")
    private Date reportTime;

    @ApiModelProperty(value = "主库ID:主库一201  主库二：202", required = true)
    @NotNull(message = "主库ID:主库一201  主库二：202不能为空")
    private Integer wareId;

    @ApiModelProperty(value = "主库名称", required = true)
    @NotBlank(message = "主库名称不能为空")
    @Length(max = 10, message = "主库名称长度不正确,最大长度10字符")
    private String wareCn;

}
