83 lines
1.4 KiB
Java
83 lines
1.4 KiB
Java
|
|
package com.example.demo.dto;
|
||
|
|
|
||
|
|
import java.util.HashMap;
|
||
|
|
import java.util.Map;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 邮件消息DTO
|
||
|
|
* 用于封装邮件发送请求
|
||
|
|
*/
|
||
|
|
public class MailMessage {
|
||
|
|
|
||
|
|
private String toEmail;
|
||
|
|
private String subject;
|
||
|
|
private Long templateId;
|
||
|
|
private Map<String, Object> templateData;
|
||
|
|
|
||
|
|
public MailMessage() {
|
||
|
|
this.templateData = new HashMap<>();
|
||
|
|
}
|
||
|
|
|
||
|
|
public MailMessage(String toEmail, String subject, Long templateId) {
|
||
|
|
this();
|
||
|
|
this.toEmail = toEmail;
|
||
|
|
this.subject = subject;
|
||
|
|
this.templateId = templateId;
|
||
|
|
}
|
||
|
|
|
||
|
|
public String getToEmail() {
|
||
|
|
return toEmail;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setToEmail(String toEmail) {
|
||
|
|
this.toEmail = toEmail;
|
||
|
|
}
|
||
|
|
|
||
|
|
public String getSubject() {
|
||
|
|
return subject;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setSubject(String subject) {
|
||
|
|
this.subject = subject;
|
||
|
|
}
|
||
|
|
|
||
|
|
public Long getTemplateId() {
|
||
|
|
return templateId;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setTemplateId(Long templateId) {
|
||
|
|
this.templateId = templateId;
|
||
|
|
}
|
||
|
|
|
||
|
|
public Map<String, Object> getTemplateData() {
|
||
|
|
return templateData;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setTemplateData(Map<String, Object> templateData) {
|
||
|
|
this.templateData = templateData;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 添加模板参数
|
||
|
|
*/
|
||
|
|
public MailMessage addParam(String key, Object value) {
|
||
|
|
this.templateData.put(key, value);
|
||
|
|
return this;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|