package com.ho.user.vo.req;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.List;

/**
 * @ClassName: UserAddReqVO
 * TODO:类文件简单描述
 * @Author:
 * @CreateDate: 2019/9/22 16:46
 * @UpdateUser:
 * @UpdateDate: 2019/9/22 16:46
 * @Version: 0.0.1
 */
@Data
public class UserAddReqVO {

    @ApiModelProperty(value = "用户名")
    @NotBlank(message = "账号不能为空")
    @Length(min = 1, max = 50,message = "账号不能超过50个字符")
    private String username;

    @ApiModelProperty(value = "真实姓名")
    @NotBlank(message = "真实姓名不能为空")
    @Length(min = 1, max = 50,message = "真实姓名不能超过50个字符")
    private String realName;

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

    @ApiModelProperty(value = "手机号码")
    @NotBlank(message = "手机号码不能为空")
    @Length(min = 11, max = 11, message = "手机号只能为11位")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
    private String phone;

    @ApiModelProperty(value = "创建来源(1.web 2.android 3.ios )")
    private Integer createWhere;

    @ApiModelProperty(value = "所属机构")
    @NotNull(message = "所属机构不能为空")
    private Integer deptId;

    @ApiModelProperty(value = "账户状态(1.正常 0.锁定)")
    private Integer status;

    @ApiModelProperty(value = "性别(1.男 2.女)")
    private Integer sex;

    @ApiModelProperty(value = "昵称")
    private String nickName;

    @ApiModelProperty(value = "邮箱")
    @Email(message = "邮箱格式有误")
    private String email;

    @ApiModelProperty(value = "备注")
    @Length(max = 200,message = "备注不能超过200个字符")
    private String remark;

    @ApiModelProperty(value = "所拥有的角色")
    private List<Integer> roleIds;

    @ApiModelProperty(value = "所拥有的岗位,可以为空")
    private List<Integer> positionIds;

    @ApiModelProperty(value = "用户等级（0代表公司内部用户，1-5分表代表不同等级的客户用户）")
    private Integer userLevel;

    @ApiModelProperty(value = "有效期（1永久，2临时）")
    private Integer periodOfValidity;
}
