package com.skr.mdm.bean.qo.system;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
 * @author nfq
 * @date 2022-11-14 16:20
 */
@ApiModel(value = "部门创建/编辑对象")
@Data
public class DepartmentQO {

    @ApiModelProperty(value = "部门ID")
    private Integer id;

    @NotBlank(message = "部门名称不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9\\u4e00-\\u9fa5]([a-zA-Z0-9\\u4e00-\\u9fa5_-]{0,48}[a-zA-Z0-9\\u4e00-\\u9fa5])?$",
            message = "部门格式错误")
    @ApiModelProperty(value = "部门名称")
    private String departmentName;

    @NotNull(message = "上级部门不能为空")
    @ApiModelProperty(value = "上级部门")
    private Integer parentId;

}
