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

import cn.reghao.jutil.jdk.db.BaseObject;
import cn.reghao.tnb.message.api.dto.EmailDto;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

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

/**
 * @author reghao
 * @date 2023-10-30 14:41:19
 */
@NoArgsConstructor
@Setter
@Getter
public class EmailAccount extends BaseObject<Integer> {
    @NotBlank
    private String smtp;
    @NotBlank
    private String username;
    @NotBlank
    private String password;
    @NotBlank
    private String personal;
    @NotNull
    private Boolean defaultSender;

    public EmailAccount(EmailDto emailDto) {
        this.smtp = emailDto.getSmtp();
        this.username = emailDto.getUsername();
        this.password = emailDto.getPassword();
        this.personal = emailDto.getPersonal();
        this.defaultSender = false;
    }
}
