package com.njcn.energy.pojo.param;

import cn.hutool.core.lang.Dict;
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.Pattern;

/**
 * pqs
 *
 * @author cdf
 * @date 2022/3/22
 */
@Data
public class DictParam {

    /**
     * 父级id
     */
    @ApiModelProperty(value = "父级id")
    private String pid;

    /**
     * 字典表字段名
     */
    @ApiModelProperty(value = "字典表字段名")
    private String name;

    /**
     * 字典表别名
     */
    @ApiModelProperty(value = "字典表别名")
    private String anotherName;


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

        @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 DictQueryParam extends BaseParam {
        @ApiModelProperty("pid")
        @NotBlank(message = ValidMessage.ID_NOT_BLANK)
        @Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
        private String pid;


    }
}
