package com.xy.dto.SysWorkUser;

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

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

@Data
@ApiModel("业务用户新增请求")
@Accessors(chain = true)
public class AddDto {

    @ApiModelProperty(value = "账号", required = true)
    @NotBlank(message = "account不可为空")
    @Pattern(regexp = "^[a-zA-z0-9]{6,11}$", message = "account必须为数字或字母，长度6-11位之间")
    private String account;

    @NotBlank(message = "email不可为空")
    @ApiModelProperty(value = "邮箱")
    @Pattern(regexp = "^(\\w+([-.][A-Za-z0-9]+)*){3,18}@\\w+([-.][A-Za-z0-9]+)*\\.\\w+([-.][A-Za-z0-9]+)*$", message = "email格式错误")
    private String email;

    @NotBlank(message = "phone不能为空")
    @ApiModelProperty(value = "手机", required = true)
    @Pattern(regexp = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,2-9]))\\d{8}$", message = "phone格式错误")
    private String phone;

    @ApiModelProperty(value = "密码", required = true)
    @NotBlank(message = "密码不可为空")
    @Pattern(regexp = "^[a-zA-z0-9]{6,11}$", message = "password必须为数字或字母，长度6-11位之间")
    private String password;

    @ApiModelProperty(value = "状态")
    private Boolean status;

    @ApiModelProperty(value = "角色ID(数组)")
    private List<Long> roleIds;

    @ApiModelProperty(value = "部门ID(数组)")
    private List<Long> deptIds;


}
