package com.ghy.common.core.domain.dto;

import com.ghy.common.core.domain.BaseEntity;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

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

/**
 * @description:
 * @author: yangdanqi
 * @date: 2023/7/1
 */
@Data
public class SysUserAddDTO  extends BaseEntity {
    @NotNull(message = "公司编码不能为空")
    private Long deptId;

    @NotBlank(message = "账号不能为空")
    @Length(min = 2, max = 20, message = "账户长度必须在2到20个字符之间")
    private String loginName;

    @NotBlank(message = "手机号码不能为空")
    @Pattern(regexp = "^1[345678]\\d{9}$", message = "手机号码格式不正确")
    private String phonenumber;

    @NotBlank(message = "密码不能为空")
    @Length(min = 5, max = 20, message = "密码长度必须在5到20个字符之间")
    private String password;
}
