package com.njcn.user.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.*;

/**
 * @author denghuajun
 * @date 2021/12/28 14:39
 *  部门
 */
@Data
public class DeptParam {

    @ApiModelProperty("父节点")
    @NotBlank(message = ValidMessage.PID_NOT_BLANK)
    private String pid;

    @ApiModelProperty("行政区域id")
    @NotBlank(message = ValidMessage.AREA_NOT_BLANK)
    @Pattern(regexp = PatternRegex.SYSTEMS_ID, message = ValidMessage.AREA_FORMAT_ERROR)
    private String area;


    @ApiModelProperty("名称")
    @NotBlank(message = ValidMessage.NAME_NOT_BLANK)
    @Pattern(regexp = PatternRegex.DEPT_NAME_REGEX, message = ValidMessage.NAME_FORMAT_ERROR)
    private String name;

    @ApiModelProperty("部门编号")
    private String code;

    /**
     * 专项分析类型区分
     */
    @ApiModelProperty("专项分析类型区分 1.本部类型 其他非本部类型")
    private Integer specialType;

    @ApiModelProperty("排序")
    @NotNull(message = ValidMessage.SORT_NOT_NULL)
    @Min(value = 0, message = ValidMessage.SORT_FORMAT_ERROR)
    @Max(value = 999, message = ValidMessage.SORT_FORMAT_ERROR)
    private Integer sort;

    @ApiModelProperty("部门类型 0-非自定义；1-web自定义；2-App自定义")
    @NotNull(message = "部门类型不能为空")
    private Integer type;

    @ApiModelProperty("描述")
    private String remark;



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

        /**
         * 表Id
         */
        @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 QueryParam extends BaseParam {



    }
}
