邮箱模块:优化注释 + 方法名
parent
1a4bea8ca2
commit
7e65ede92d
|
@ -19,7 +19,7 @@ public interface MailSendApi {
|
||||||
* @param reqDTO 发送请求
|
* @param reqDTO 发送请求
|
||||||
* @return 发送日志编号
|
* @return 发送日志编号
|
||||||
*/
|
*/
|
||||||
Long sendSingleSmsToAdmin(@Valid MailSendSingleToUserReqDTO reqDTO);
|
Long sendSingleMailToAdmin(@Valid MailSendSingleToUserReqDTO reqDTO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送单条邮箱给 Member 用户
|
* 发送单条邮箱给 Member 用户
|
||||||
|
@ -29,6 +29,6 @@ public interface MailSendApi {
|
||||||
* @param reqDTO 发送请求
|
* @param reqDTO 发送请求
|
||||||
* @return 发送日志编号
|
* @return 发送日志编号
|
||||||
*/
|
*/
|
||||||
Long sendSingleSmsToMember(@Valid MailSendSingleToUserReqDTO reqDTO);
|
Long sendSingleMailToMember(@Valid MailSendSingleToUserReqDTO reqDTO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,13 +20,13 @@ public class MailSendApiImpl implements MailSendApi {
|
||||||
private MailSendService mailSendService;
|
private MailSendService mailSendService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long sendSingleSmsToAdmin(MailSendSingleToUserReqDTO reqDTO) {
|
public Long sendSingleMailToAdmin(MailSendSingleToUserReqDTO reqDTO) {
|
||||||
return mailSendService.sendSingleMailToAdmin(reqDTO.getMail(), reqDTO.getUserId(),
|
return mailSendService.sendSingleMailToAdmin(reqDTO.getMail(), reqDTO.getUserId(),
|
||||||
reqDTO.getTemplateCode(), reqDTO.getTemplateParams());
|
reqDTO.getTemplateCode(), reqDTO.getTemplateParams());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long sendSingleSmsToMember(MailSendSingleToUserReqDTO reqDTO) {
|
public Long sendSingleMailToMember(MailSendSingleToUserReqDTO reqDTO) {
|
||||||
return mailSendService.sendSingleMailToMember(reqDTO.getMail(), reqDTO.getUserId(),
|
return mailSendService.sendSingleMailToMember(reqDTO.getMail(), reqDTO.getUserId(),
|
||||||
reqDTO.getTemplateCode(), reqDTO.getTemplateParams());
|
reqDTO.getTemplateCode(), reqDTO.getTemplateParams());
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package cn.iocoder.yudao.module.system.mq.consumer.mail;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessageListener;
|
||||||
|
import cn.iocoder.yudao.module.system.mq.message.mail.MailAccountRefreshMessage;
|
||||||
|
import cn.iocoder.yudao.module.system.mq.message.mail.MailTemplateRefreshMessage;
|
||||||
|
import cn.iocoder.yudao.module.system.service.mail.MailAccountService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.mail.MailTemplateService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对 {@link MailAccountRefreshMessage} 的消费者
|
||||||
|
*
|
||||||
|
* @author wangjingyi
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class MailAccountRefreshConsumer extends AbstractChannelMessageListener<MailAccountRefreshMessage> {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MailAccountService mailAccountService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMessage(MailAccountRefreshMessage message) {
|
||||||
|
log.info("[onMessage][收到 Mail Account 刷新信息]");
|
||||||
|
mailAccountService.initLocalCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -2,19 +2,25 @@ package cn.iocoder.yudao.module.system.mq.consumer.mail;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.mq.core.stream.AbstractStreamMessageListener;
|
import cn.iocoder.yudao.framework.mq.core.stream.AbstractStreamMessageListener;
|
||||||
import cn.iocoder.yudao.module.system.mq.message.mail.MailSendMessage;
|
import cn.iocoder.yudao.module.system.mq.message.mail.MailSendMessage;
|
||||||
|
import cn.iocoder.yudao.module.system.mq.message.sms.SmsSendMessage;
|
||||||
import cn.iocoder.yudao.module.system.service.mail.MailSendService;
|
import cn.iocoder.yudao.module.system.service.mail.MailSendService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对 {@link MailSendMessage} 的消费者
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class MailSendConsumer extends AbstractStreamMessageListener<MailSendMessage> {
|
public class MailSendConsumer extends AbstractStreamMessageListener<MailSendMessage> {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private MailSendService mailSendService;
|
private MailSendService mailSendService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessage(MailSendMessage message) {
|
public void onMessage(MailSendMessage message) {
|
||||||
log.info("[onMessage][消息内容({})]", message);
|
log.info("[onMessage][消息内容({})]", message);
|
||||||
|
|
|
@ -25,4 +25,5 @@ public class MailTemplateRefreshConsumer extends AbstractChannelMessageListener<
|
||||||
log.info("[onMessage][收到 Mail Template 刷新信息]");
|
log.info("[onMessage][收到 Mail Template 刷新信息]");
|
||||||
mailTemplateService.initLocalCache();
|
mailTemplateService.initLocalCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,10 @@ import lombok.EqualsAndHashCode;
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class MailAccountRefreshMessage extends AbstractChannelMessage {
|
public class MailAccountRefreshMessage extends AbstractChannelMessage {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getChannel() {
|
public String getChannel() {
|
||||||
return "system.mail-account.refresh";
|
return "system.mail-account.refresh";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,10 @@ import lombok.EqualsAndHashCode;
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class MailTemplateRefreshMessage extends AbstractChannelMessage {
|
public class MailTemplateRefreshMessage extends AbstractChannelMessage {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getChannel() {
|
public String getChannel() {
|
||||||
return "system.mail-template.refresh";
|
return "system.mail-template.refresh";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class MailProducer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送 {@link MailTemplateRefreshMessage} 消息
|
* 发送 {@link MailAccountRefreshMessage} 消息
|
||||||
*/
|
*/
|
||||||
public void sendMailAccountRefreshMessage() {
|
public void sendMailAccountRefreshMessage() {
|
||||||
MailAccountRefreshMessage message = new MailAccountRefreshMessage();
|
MailAccountRefreshMessage message = new MailAccountRefreshMessage();
|
||||||
|
|
Loading…
Reference in New Issue