package com.njcn.device.pq.pojo.param;

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

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

/**
 * 供电公司信息表
 *
 * @author hongawen
 * @since 2021-04-09
 */
@Data
@ApiModel
public class GdInformationParam {


    @ApiModelProperty(name = "name",value = "供电公司名称",required = true)
    @NotBlank(message = "供电公司名称")
    @Pattern(regexp = PatternRegex.DEV_NAME_REGEX,message = "供电公司名称违规")
    private String name;

    @ApiModelProperty(name = "sort",value = "排序",required = true)
    @NotNull(message = "排序不可为空")
    @Min(value = 0,message = "排序格式有误")
    private Integer sort;

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

        /**
         * 表Id
         */
        @ApiModelProperty("gdIndex")
        @NotBlank(message = ValidMessage.ID_NOT_BLANK)
        @Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
        private String gdIndex;
    }
}
