package cn.reghao.tnb.message.app.model.po;

import cn.reghao.jutil.jdk.web.db.BaseObject;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;

/**
 * @author reghao
 * @date 2023-10-30 14:41:19
 */
@NoArgsConstructor
@Setter
@Getter
public class EmailAccount extends BaseObject<Integer> {
    @NotBlank
    @Pattern(regexp = "^(?=^.{3,255}$)[a-z0-9][-a-z0-9]{0,62}(\\.[a-z0-9][-a-z0-9]{0,62})+$", message = "SMTP 域名格式不正确")
    private String smtp;
    @NotBlank
    @Pattern(regexp = "^s*\\w+(?:\\.{0,1}[\\w-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\\.[a-zA-Z]+\\s*$", message = "邮箱格式不正确")
    private String username;
    @NotBlank
    @Size(min = 8, max = 20, message = "password 长度在 8 ~ 20 个字符之间")
    private String password;
    @NotBlank
    @Size(min = 3, max = 10, message = "personal 长度在 3 ~ 10 个字符之间")
    private String personal;
}
