package com.smppw.modaq.domain.dto;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Objects;

@Setter
@Getter
public class EmailContentInfoDTO implements Serializable {

    /**
     * 邮件id(重新解析邮件功能)
     */
    private Integer emailId;
    /**
     * 邮箱地址
     */
    private String emailAddress;

    /**
     * 邮件主题
     */
    private String emailTitle;

    /**
     * 邮件日期:yyyyMMdd HH:mm:ss
     */
    private String emailDate;

    /**
     * 解析时间
     */
    private String parseDate;

    /**
     * 附件名称
     */
    private String fileName;

    /**
     * 附件地址
     */
    private String filePath;

    /**
     * 文件类型:1-净值文件,2-估值表文件,3-定期报告
     */
    private Integer emailType;

    /**
     * 邮件内容
     */
    private String emailContent;

    /**
     * 邮件发送人
     */
    private String senderEmail;

    /**
     * 文件id(重新解析邮件功能)
     */
    private Integer fileId;

    /**
     * ai解析时的文件id（重新解析邮件时用这个可以不用重复上传）
     */
    private String aiFileId;

    /**
     * 附件大小byte
     */
    private int fileSize;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof EmailContentInfoDTO that)) return false;
        return Objects.equals(emailAddress, that.emailAddress)
                && Objects.equals(emailTitle, that.emailTitle)
                && Objects.equals(emailDate, that.emailDate)
                && Objects.equals(fileName, that.fileName)
                && Objects.equals(filePath, that.filePath)
                && Objects.equals(fileSize, that.fileSize)
                && Objects.equals(emailType, that.emailType)
                && Objects.equals(senderEmail, that.senderEmail);
    }

    @Override
    public int hashCode() {
        return Objects.hash(emailAddress, emailTitle, emailDate, fileName, filePath, fileSize, emailType, senderEmail);
    }

    @Override
    public String toString() {
        return "{" +
                "emailAddress='" + emailAddress + '\'' +
                ", emailTitle='" + emailTitle + '\'' +
                ", emailDate='" + emailDate + '\'' +
                ", senderEmail='" + senderEmail + '\'' +
                ", fileName='" + fileName + '\'' +
                ", emailType=" + emailType +
                '}';
    }
}

