谷歌马甲包-代码-清理部分废弃功能
This commit is contained in:
@@ -29,9 +29,6 @@ public interface MqConstant {
|
||||
String PAY_FINISH_TOPIC = "pay_finish_topic";
|
||||
String PAY_FINISH_CONSUME_GROUP = "pay_finish_consume_group";
|
||||
|
||||
String USER_FIRST_LOGIN_TOPIC = "user_first_login_topic";
|
||||
String USER_FIRST_LOGIN_CONSUME_GROUP = "user_first_login_consume_group";
|
||||
|
||||
String VOICE_LIKE_TOPIC = "voice_like_topic";
|
||||
String VOICE_LIKE_CONSUME_GROUP = "voice_like_consume_group";
|
||||
|
||||
|
@@ -1,79 +0,0 @@
|
||||
package com.accompany.mq.consumer;
|
||||
|
||||
|
||||
import com.accompany.business.service.gamemange.GameManageAccessTicketBizService;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.utils.BlankUtil;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import com.accompany.core.vo.UserFirstLoginMsgVO;
|
||||
import com.accompany.mq.constant.MqConstant;
|
||||
import com.accompany.mq.listener.AbstractMessageListener;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.xuanyin.gamematch.constants.GameManageAccessTicketEnum;
|
||||
import com.xuanyin.gamematch.handler.ticketaccessstatey.ITicketAccessStategy;
|
||||
import com.xuanyin.gamematch.handler.ticketaccessstatey.TicketAccessStategyFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@ConditionalOnProperty(name = "spring.application.name", havingValue = "web")
|
||||
@RocketMQMessageListener(topic = MqConstant.USER_FIRST_LOGIN_TOPIC, consumerGroup = MqConstant.USER_FIRST_LOGIN_CONSUME_GROUP)
|
||||
public class UserFirstLoginMessageConsumer extends AbstractMessageListener<UserFirstLoginMsgVO> {
|
||||
|
||||
@Autowired
|
||||
private JedisService jedisService;
|
||||
@Autowired
|
||||
private TicketAccessStategyFactory factory;
|
||||
@Autowired
|
||||
private GameManageAccessTicketBizService gameManageAccessTicketBizService;
|
||||
|
||||
@Override
|
||||
public void onMessage(UserFirstLoginMsgVO msg) {
|
||||
log.info("用户首登消息队列, msg: {} ", JSON.toJSONString(msg));
|
||||
// 判断该消息是否已经消费过
|
||||
String messStatus = jedisService.hget(RedisKey.mq_user_first_login_status.getKey(), msg.getUid().toString());
|
||||
if (BlankUtil.isBlank(messStatus)) {
|
||||
return;
|
||||
}
|
||||
handleDayFirstLogin(msg);
|
||||
handleWeekFirstLogin(msg);
|
||||
jedisService.hdel(RedisKey.mq_user_first_login_status.getKey(), msg.getUid().toString());
|
||||
}
|
||||
|
||||
@Async
|
||||
void handleDayFirstLogin(UserFirstLoginMsgVO msg) {
|
||||
if (msg.getIsDayFirstLogin()) {
|
||||
try {
|
||||
log.info("处理用户每日首登 uid {}", msg.getUid());
|
||||
ITicketAccessStategy stategy = factory.getInstance(GameManageAccessTicketEnum.DAY_LOGIN.getValue());
|
||||
stategy.doSend(msg.getUid());
|
||||
gameManageAccessTicketBizService.setTicketAccessInfoToCache(stategy.getAccessType().getValue(), msg.getUid());
|
||||
} catch (ServiceException ignored){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Async
|
||||
void handleWeekFirstLogin(UserFirstLoginMsgVO msg) {
|
||||
if (msg.getIsWeekFirstLogin()) {
|
||||
try {
|
||||
log.info("处理用户每周首登 uid {}", msg.getUid());
|
||||
ITicketAccessStategy stategy = factory.getInstance(GameManageAccessTicketEnum.WEEK_LOGIN.getValue());
|
||||
stategy.doSend(msg.getUid());
|
||||
gameManageAccessTicketBizService.setTicketAccessInfoToCache(stategy.getAccessType().getValue(), msg.getUid());
|
||||
} catch (ServiceException ignored){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user