package com.fjhx.mail.entity.message.dto;

import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

@Getter
@Setter
public class SendDto {

    /**
     * 1个人邮箱 2企业邮箱
     */
    @NotNull(message = "类型不能未空")
    private Integer type;

    /**
     * 邮箱id
     */
    @NotNull(message = "邮箱id不能为空")
    private Long mailboxId;

    /**
     * 发送
     */
    @NotEmpty(message = "发送人不能为空")
    private List<Address> to;

    /**
     * 抄送
     */
    private List<Address> cc;

    /**
     * 密送
     */
    private List<Address> bcc;

    /**
     * 回复
     */
    private List<Address> replyTo;

    /**
     * 标题
     */
    @NotBlank(message = "标题不能为空")
    private String subject;

    /**
     * 正文
     */
    private String content;

    /**
     * 附件
     */
    @Valid
    private List<FileInfo> fileList;

    @Getter
    @Setter
    public static class Address {
        @NotBlank(message = "发件地址不能为空")
        private String address;
        private String personal;
    }

    @Getter
    @Setter
    public static class FileInfo {

        /**
         * 文件名称
         */
        @NotBlank(message = "文件名称不能为空")
        private String fileName;

        /**
         * 文件路径
         */
        @NotBlank(message = "文件路径不能为空")
        private String fileUrl;

    }

}
