【新增】模块exam,judgement并修改pom文件,新增rabbitmq依赖
This commit is contained in:
@@ -29,6 +29,12 @@
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!--RabbitMQ-->
|
||||
<dependency>
|
||||
<groupId>pc.exam.gg</groupId>
|
||||
<artifactId>exam-spring-boot-starter-mq</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
<groupId>pc.exam.gg</groupId>
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package pc.exam.pp.module.system.mq.consumer.sms;
|
||||
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import pc.exam.pp.module.system.mq.message.sms.SmsSendMessage;
|
||||
import pc.exam.pp.module.system.service.sms.SmsSendService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -15,6 +16,7 @@ import jakarta.annotation.Resource;
|
||||
* @author zzf
|
||||
*/
|
||||
@Component
|
||||
@RabbitListener(queues = SmsSendMessage.QUEUE)
|
||||
@Slf4j
|
||||
public class SmsSendConsumer {
|
||||
|
||||
|
@@ -14,6 +14,8 @@ import java.util.List;
|
||||
@Data
|
||||
public class SmsSendMessage {
|
||||
|
||||
public static final String QUEUE = "SEND_MESSAGE_QUEUE"; // 重点:需要增加消息对应的 Queue
|
||||
|
||||
/**
|
||||
* 短信日志编号
|
||||
*/
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package pc.exam.pp.module.system.mq.producer.sms;
|
||||
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import pc.exam.pp.framework.common.core.KeyValue;
|
||||
import pc.exam.pp.module.system.mq.message.sms.SmsSendMessage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -21,7 +22,23 @@ public class SmsProducer {
|
||||
|
||||
@Resource
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@Resource
|
||||
private RabbitTemplate rabbitTemplate; // 重点:注入 RabbitTemplate 对象
|
||||
/**
|
||||
* 发送 {@link SmsSendMessage} 消息
|
||||
*
|
||||
* @param logId 短信日志编号
|
||||
* @param mobile 手机号
|
||||
* @param channelId 渠道编号
|
||||
* @param apiTemplateId 短信模板编号
|
||||
* @param templateParams 短信模板参数
|
||||
*/
|
||||
// public void sendSmsSendMessage(Long logId, String mobile,
|
||||
// Long channelId, String apiTemplateId, List<KeyValue<String, Object>> templateParams) {
|
||||
// SmsSendMessage message = new SmsSendMessage().setLogId(logId).setMobile(mobile);
|
||||
// message.setChannelId(channelId).setApiTemplateId(apiTemplateId).setTemplateParams(templateParams);
|
||||
// applicationContext.publishEvent(message);
|
||||
// }
|
||||
/**
|
||||
* 发送 {@link SmsSendMessage} 消息
|
||||
*
|
||||
@@ -35,7 +52,7 @@ public class SmsProducer {
|
||||
Long channelId, String apiTemplateId, List<KeyValue<String, Object>> templateParams) {
|
||||
SmsSendMessage message = new SmsSendMessage().setLogId(logId).setMobile(mobile);
|
||||
message.setChannelId(channelId).setApiTemplateId(apiTemplateId).setTemplateParams(templateParams);
|
||||
applicationContext.publishEvent(message);
|
||||
rabbitTemplate.convertAndSend(SmsSendMessage.QUEUE, message); // 重点:使用 RabbitTemplate 发送消息
|
||||
}
|
||||
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -14,7 +14,7 @@ import pc.exam.pp.module.system.dal.dataobject.permission.MenuDO;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2025-04-17T13:07:54+0800",
|
||||
date = "2025-04-18T13:31:34+0800",
|
||||
comments = "version: 1.6.3, compiler: javac, environment: Java 17.0.13 (Oracle Corporation)"
|
||||
)
|
||||
public class AuthConvertImpl implements AuthConvert {
|
||||
|
@@ -4,7 +4,7 @@ import javax.annotation.processing.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2025-04-17T13:07:54+0800",
|
||||
date = "2025-04-18T13:31:34+0800",
|
||||
comments = "version: 1.6.3, compiler: javac, environment: Java 17.0.13 (Oracle Corporation)"
|
||||
)
|
||||
public class OAuth2OpenConvertImpl implements OAuth2OpenConvert {
|
||||
|
@@ -6,7 +6,7 @@ import pc.exam.pp.module.system.controller.admin.socail.vo.user.SocialUserBindRe
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2025-04-17T13:07:54+0800",
|
||||
date = "2025-04-18T13:31:34+0800",
|
||||
comments = "version: 1.6.3, compiler: javac, environment: Java 17.0.13 (Oracle Corporation)"
|
||||
)
|
||||
public class SocialUserConvertImpl implements SocialUserConvert {
|
||||
|
@@ -4,7 +4,7 @@ import javax.annotation.processing.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2025-04-17T13:07:54+0800",
|
||||
date = "2025-04-18T13:31:34+0800",
|
||||
comments = "version: 1.6.3, compiler: javac, environment: Java 17.0.13 (Oracle Corporation)"
|
||||
)
|
||||
public class TenantConvertImpl implements TenantConvert {
|
||||
|
@@ -4,7 +4,7 @@ import javax.annotation.processing.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2025-04-17T13:07:54+0800",
|
||||
date = "2025-04-18T13:31:34+0800",
|
||||
comments = "version: 1.6.3, compiler: javac, environment: Java 17.0.13 (Oracle Corporation)"
|
||||
)
|
||||
public class UserConvertImpl implements UserConvert {
|
||||
|
Reference in New Issue
Block a user