package com.njcn.energy.pojo.param;

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

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

/**
 * 类的介绍：
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2022/3/9 10:08
 */
@Data
public class DataSetParam {


    @ApiModelProperty(value = "数据模板表Id")
    @NotEmpty(message = "数据模板表Id不可为空")
    private String pid;

    @ApiModelProperty(value = "数据集名称")
    @NotEmpty(message = "数据集名称不可为空")
    private String name;

    @ApiModelProperty(value = "数据集序号")
    @NotNull(message = "数据集序号不可为空")
    private Integer idx;

    @ApiModelProperty(value = "数据集别名")
    private String anotherName;

    /**
     * 0 不存储
     * 1 存储
     */
    @ApiModelProperty(value = "是否存储")
    @NotNull(message = "数据集序号不可为空")
    private Integer storeFlag;

    /**
     * 更新操作实体
     */
    @Data
    @EqualsAndHashCode(callSuper = true)
    public static class DataSetUpdateParam extends DataSetParam {

        @ApiModelProperty("id")
        @NotBlank(message = ValidMessage.ID_NOT_BLANK)
        @Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
        private String id;
    }

    /**
     * 分页查询实体
     */
    @Data
    @EqualsAndHashCode(callSuper = true)
    public static class DataSetQueryParam extends BaseParam {


    }

}
