Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/dev-yunai

This commit is contained in:
YunaiV
2023-02-01 21:09:29 +08:00
188 changed files with 9438 additions and 347 deletions

View File

@ -0,0 +1,34 @@
package cn.iocoder.yudao.module.system.api.mail;
import cn.iocoder.yudao.module.system.api.mail.dto.MailSendSingleToUserReqDTO;
import javax.validation.Valid;
/**
* 邮箱发送 API 接口
*
* @author 芋道源码
*/
public interface MailSendApi {
/**
* 发送单条邮箱给 Admin 用户
*
* 在 mail 为空时,使用 userId 加载对应 Admin 的邮箱
*
* @param reqDTO 发送请求
* @return 发送日志编号
*/
Long sendSingleMailToAdmin(@Valid MailSendSingleToUserReqDTO reqDTO);
/**
* 发送单条邮箱给 Member 用户
*
* 在 mail 为空时,使用 userId 加载对应 Member 的邮箱
*
* @param reqDTO 发送请求
* @return 发送日志编号
*/
Long sendSingleMailToMember(@Valid MailSendSingleToUserReqDTO reqDTO);
}

View File

@ -0,0 +1,37 @@
package cn.iocoder.yudao.module.system.api.mail.dto;
import lombok.Data;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import java.util.Map;
/**
* 邮件发送 Request DTO
*
* @author wangjingqi
*/
@Data
public class MailSendSingleToUserReqDTO {
/**
* 用户编号
*/
private Long userId;
/**
* 邮箱
*/
@Email
private String mail;
/**
* 邮件模板编号
*/
@NotNull(message = "邮件模板编号不能为空")
private String templateCode;
/**
* 邮件模板参数
*/
private Map<String, Object> templateParams;
}

View File

@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.system.api.notify;
import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
import javax.validation.Valid;
/**
* 站内信发送 API 接口
*
* @author xrcoder
*/
public interface NotifyMessageSendApi {
/**
* 发送单条站内信给 Admin 用户
*
* @param reqDTO 发送请求
* @return 发送消息 ID
*/
Long sendSingleMessageToAdmin(@Valid NotifySendSingleToUserReqDTO reqDTO);
/**
* 发送单条站内信给 Member 用户
*
* @param reqDTO 发送请求
* @return 发送消息 ID
*/
Long sendSingleMessageToMember(@Valid NotifySendSingleToUserReqDTO reqDTO);
}

View File

@ -0,0 +1,33 @@
package cn.iocoder.yudao.module.system.api.notify.dto;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Map;
/**
* 站内信发送给 Admin 或者 Member 用户
*
* @author xrcoder
*/
@Data
public class NotifySendSingleToUserReqDTO {
/**
* 用户编号
*/
@NotNull(message = "用户编号不能为空")
private Long userId;
/**
* 站内信模板编号
*/
@NotEmpty(message = "站内信模板编号不能为空")
private String templateCode;
/**
* 站内信模板参数
*/
private Map<String, Object> templateParams;
}

View File

@ -141,4 +141,25 @@ public interface ErrorCodeConstants {
ErrorCode OAUTH2_CODE_NOT_EXISTS = new ErrorCode(1002022000, "code 不存在");
ErrorCode OAUTH2_CODE_EXPIRE = new ErrorCode(1002022001, "code 已过期");
// ========== 邮箱账号 1002023000 ==========
ErrorCode MAIL_ACCOUNT_NOT_EXISTS = new ErrorCode(1002023000, "邮箱账号不存在");
ErrorCode MAIL_ACCOUNT_RELATE_TEMPLATE_EXISTS = new ErrorCode(1002023001, "无法删除,该邮箱账号还有邮件模板");
// ========== 邮件模版 1002024000 ==========
ErrorCode MAIL_TEMPLATE_NOT_EXISTS = new ErrorCode(1002024000, "邮件模版不存在");
ErrorCode MAIL_TEMPLATE_CODE_EXISTS = new ErrorCode(1002024001, "邮件模版 code({}) 已存在");
// ========== 邮件发送 1002025000 ==========
ErrorCode MAIL_SEND_TEMPLATE_PARAM_MISS = new ErrorCode(1002025000, "模板参数({})缺失");
ErrorCode MAIL_SEND_MAIL_NOT_EXISTS = new ErrorCode(1002025000, "邮箱不存在");
// ========== 站内信模版 1002026000 ==========
ErrorCode NOTIFY_TEMPLATE_NOT_EXISTS = new ErrorCode(1002026000, "站内信模版不存在");
ErrorCode NOTIFY_TEMPLATE_CODE_DUPLICATE = new ErrorCode(1002026001, "已经存在编码为【{}】的站内信模板");
// ========== 站内信模版 1002027000 ==========
// ========== 站内信发送 1002028000 ==========
ErrorCode NOTIFY_SEND_TEMPLATE_PARAM_MISS = new ErrorCode(1002025000, "模板参数({})缺失");
}

View File

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