邮件模块 添加邮件发送api

This commit is contained in:
wangjingyi
2022-04-30 21:31:55 +08:00
parent d1812761db
commit d7305739d3
44 changed files with 1085 additions and 59 deletions

View File

@ -0,0 +1,4 @@
package cn.iocoder.yudao.module.system.api.mail;
public interface MailSendApi {
}

View File

@ -0,0 +1,38 @@
package cn.iocoder.yudao.module.system.api.mail.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import java.util.List;
@ApiModel("管理后台 - 邮件发送 Req VO")
@Data
public class MailSendReqDTO { // TODO @wangjingqi1, 不用空格2应该只要传递 templateCode、参数就好title、from、content、附件应该都是参数里的
@ApiModelProperty(value = "邮箱",required = true,example = "yudaoyuanma@123.com")
@NotNull(message = "邮箱账号不能为空")
@Email(message = "邮箱账号格式错误")
private String from;
@ApiModelProperty(value = "标题",example = "标题")
private String title;
@ApiModelProperty(value = "内容",example = "内容")
private String content;
@ApiModelProperty(value = "邮箱模版id",example = "1024")
@NotNull(message = "邮箱模版id不能为空")
private Integer templateId;
@ApiModelProperty(value = "收件人",required = true,example = "yudaoyuanma@123.com")
@NotNull(message = "收件人不能为空")
private List<String> tos;
@ApiModelProperty(value = "附件",example = "附件编码")
private List<String> fileIds;
}

View File

@ -126,5 +126,6 @@ public interface ErrorCodeConstants {
// ========== 邮箱模版 1002020000 ==========
ErrorCode MAIL_TEMPLATE_NOT_EXISTS = new ErrorCode(1002020000 , "邮箱模版不存在");
ErrorCode MAIL_TEMPLATE_EXISTS = new ErrorCode(1002020001, "邮箱模版存在");
ErrorCode MAIL_RELATE_TEMPLATE_EXISTS = new ErrorCode(1002020002, "存在关联邮箱模版");
}

View File

@ -0,0 +1,24 @@
package cn.iocoder.yudao.module.system.enums.mail;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 邮件的发送状态枚举
*
* @author wangjingyi
* @date 2022/4/10 13:39
*/
@Getter
@AllArgsConstructor
public enum MailSendStatusEnum {
INIT(0), // 初始化
SUCCESS(10), // 发送成功
FAILURE(20), // 发送失败
IGNORE(30), // 忽略,即不发送
;
private final int status;
}