New file |
| | |
| | | package com.yeshi.fanli.util.rocketmq.consumer.user;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Action;
|
| | | import com.aliyun.openservices.ons.api.ConsumeContext;
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.MessageListener;
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.order.body.OrderMoneyRecievedMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInviteMQMsg;
|
| | | import com.yeshi.fanli.exception.money.OrderMoneySettleException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | /**
|
| | | * 用户超级会员
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | //@Component implements MessageListener
|
| | | public class UserVIPMessageListener {
|
| | |
|
| | | @Resource
|
| | | private UserVIPPreInfoService userVIPPreInfoService;
|
| | |
|
| | | // @Override
|
| | | // public Action consume(Message message, ConsumeContext context) {
|
| | | // |
| | | // LogHelper.mqInfo("consumer-UserVIPMessageListener", message.getMsgID(), message.getTopic(),
|
| | | // message.getTag(), new String(message.getBody()));
|
| | | // String tag = message.getTag();
|
| | | // if (tag == null)
|
| | | // tag = "";
|
| | | //
|
| | | // // 邀请相关
|
| | | // if (MQTopicName.TOPIC_USER.name().equalsIgnoreCase(message.getTopic())) {
|
| | | // // 邀请成功
|
| | | // if (tag.equalsIgnoreCase(UserTopicTagEnum.inviteSuccess.name())) {
|
| | | // UserInviteMQMsg msg = new Gson().fromJson(new String(message.getBody()),UserInviteMQMsg.class);
|
| | | // // 会员等级升级
|
| | | // userVIPPreInfoService.verifyVipPreInfo(msg.getBossId(), true);
|
| | | // }
|
| | | // }
|
| | | // |
| | | // // 订单到账相关
|
| | | // if (tag.equalsIgnoreCase(OrderTopicTagEnum.orderFanLiActual.name())) {
|
| | | // OrderMoneyRecievedMQMsg dto = new Gson().fromJson(new String(message.getBody()),
|
| | | // OrderMoneyRecievedMQMsg.class);
|
| | | // if (dto != null) {
|
| | | // if (dto.getType() == OrderMoneyRecievedMQMsg.TYPE_ZIGOU) {// 自购到账
|
| | | // // 会员等级升级
|
| | | // userVIPPreInfoService.verifyVipPreInfo(dto.getUid(), false);
|
| | | // } else if (dto.getType() == OrderMoneyRecievedMQMsg.TYPE_SHARE) {// 分享到账
|
| | | // // 会员等级升级
|
| | | // userVIPPreInfoService.verifyVipPreInfo(dto.getUid(), false);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | | // |
| | | // return Action.CommitMessage;
|
| | | // }
|
| | | }
|