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

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 2023-01-30 14:55
 */
@Data
@ApiModel(value = "用户添加/编辑QO")
public class UserAddUpdateQO {

    @ApiModelProperty(value = "用户ID")
    private Integer id;

    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp = "^[\\u4E00-\\u9FA5A-Za-z0-9]{2,20}$", message = "用户名格式错误")
    @ApiModelProperty(value = "用户名", required = true)
    private String userName;

    @ApiModelProperty(value = "密码", required = true)
    private String password;

    @NotNull(message = "部门不能为空")
    @ApiModelProperty(value = "部门id", required = true)
    private Integer departmentId;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^(?:(?:\\+|00)86)?1\\d{10}$", message = "手机号格式错误")
    @ApiModelProperty(value = "手机号")
    private String phoneNumber;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(hidden = true)
    private Integer companyId;

}
