package com.smppw.modaq.domain.dto;

import cn.hutool.core.collection.ListUtil;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Setter
@Getter
public class EmailInfoDTO {
    /**
     * 邮箱地址
     */
    private String emailAddress;
    /**
     * 邮件主题
     */
    private String emailTitle;
    /**
     * 邮件日期:yyyyMMdd HH:mm:ss
     */
    private String emailDate;
    /**
     * 邮件发送人
     */
    private String senderEmail;
    /**
     * 当前邮件的所有附件信息（如果是压缩包则只记录解压后的文件）
     */
    private List<EmailZipFileDTO> emailFileList;

    public EmailInfoDTO() {
        this.emailFileList = ListUtil.list(false);
    }

    public EmailInfoDTO(String emailTitle, List<EmailZipFileDTO> emailFileList) {
        this();
        this.emailTitle = emailTitle;
        this.emailFileList = emailFileList;
    }

    public EmailInfoDTO(EmailContentInfoDTO emailDto, List<EmailZipFileDTO> emailFileList) {
        this();
        this.emailAddress = emailDto.getEmailAddress();
        this.emailTitle = emailDto.getEmailTitle();
        this.emailDate = emailDto.getEmailDate();
        this.senderEmail = emailDto.getSenderEmail();
        this.emailFileList = emailFileList;
    }
}
