-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(): 优化代码[发送验证码] #3190
feat(): 优化代码[发送验证码] #3190
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,35 +17,37 @@ | |
|
||
package org.laokou.auth.consumer.handler; | ||
|
||
import io.micrometer.common.lang.NonNullApi; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; | ||
import org.laokou.common.domain.handler.AbstractDomainEventHandler; | ||
import org.laokou.common.domain.support.DomainEventPublisher; | ||
import org.laokou.common.redis.utils.RedisUtil; | ||
import org.laokou.common.sms.service.SmsService; | ||
import org.laokou.common.i18n.dto.DomainEvent; | ||
import org.springframework.stereotype.Component; | ||
|
||
import static org.apache.rocketmq.spring.annotation.ConsumeMode.CONCURRENTLY; | ||
import static org.apache.rocketmq.spring.annotation.MessageModel.CLUSTERING; | ||
import static org.laokou.auth.common.constant.MqConstant.LAOKOU_MOBILE_CAPTCHA_CONSUMER_GROUP; | ||
import static org.laokou.auth.common.constant.MqConstant.MOBILE_TAG; | ||
import static org.laokou.auth.model.Constant.LAOKOU_CAPTCHA_TOPIC; | ||
|
||
/** | ||
* @author laokou | ||
*/ | ||
// @Slf4j | ||
// @Component | ||
// @NonNullApi | ||
// @RocketMQMessageListener(consumerGroup = LAOKOU_MOBILE_CAPTCHA_CONSUMER_GROUP, topic = | ||
// LAOKOU_CAPTCHA_TOPIC, | ||
// selectorExpression = MOBILE_TAG, messageModel = CLUSTERING, consumeMode = CONCURRENTLY) | ||
public class SendMobileCaptchaEventHandler { | ||
|
||
private final SmsService smsService; | ||
|
||
private final RedisUtil redisUtil; | ||
|
||
public SendMobileCaptchaEventHandler(DomainEventPublisher domainEventPublisher, SmsService smsService, | ||
RedisUtil redisUtil) { | ||
// super(domainEventPublisher); | ||
this.smsService = smsService; | ||
this.redisUtil = redisUtil; | ||
@Slf4j | ||
@Component | ||
@NonNullApi | ||
@RocketMQMessageListener(consumerGroup = LAOKOU_MOBILE_CAPTCHA_CONSUMER_GROUP, topic = LAOKOU_CAPTCHA_TOPIC, | ||
selectorExpression = MOBILE_TAG, messageModel = CLUSTERING, consumeMode = CONCURRENTLY) | ||
public class SendMobileCaptchaEventHandler extends AbstractDomainEventHandler { | ||
|
||
public SendMobileCaptchaEventHandler(DomainEventPublisher rocketMQDomainEventPublisher) { | ||
super(rocketMQDomainEventPublisher); | ||
} | ||
|
||
// @Override | ||
// protected NoticeLog getNoticeLog(SendCaptchaEvent event) { | ||
// return smsService.send(event.getUuid(), 5); | ||
// } | ||
@Override | ||
protected void handleDomainEvent(DomainEvent domainEvent) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): handleDomainEvent 方法是空的,可能导致移动验证码事件丢失。 实现正确的事件处理逻辑以确保移动验证码事件被正确处理。 Original comment in Englishissue (bug_risk): The handleDomainEvent method is empty, potentially causing mobile captcha events to be lost. Implement proper event handling logic to ensure mobile captcha events are processed correctly. |
||
|
||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): handleDomainEvent 方法是空的,这可能导致事件被静默丢弃。
实现正确的事件处理逻辑以确保邮件验证码事件被正确处理。
Original comment in English
issue (bug_risk): The handleDomainEvent method is empty, which could lead to silently dropped events.
Implement proper event handling logic to ensure mail captcha events are processed correctly.