| | |
| | | import com.yeshi.fanli.entity.redpack.RedPackDetail;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackGiveRecord;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.exception.redpack.RedPackGiveRecordException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
|
| | |
| | | import com.yeshi.fanli.service.inter.redpack.RedPackGiveRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.TokenRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.manger.msg.RocketMQManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TokenUtil;
|
| | |
| | | @Resource
|
| | | private RedPackForbidService redPackForbidService;
|
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | | @Resource
|
| | | private RocketMQManager rocketMQManager;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
| | | msg.setId(giveRecord.getId());
|
| | | msg.setUid(uid);
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.redPackGiftDrawback, msg);
|
| | | message.setStartDeliverTime(endTime.getTime() + 1000 * 60); // 延迟一分钟
|
| | | |
| | | |
| | | try {
|
| | | producer.send(message);
|
| | | rocketMQManager.sendNormalMsg(message,1000 * 60L, null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | throw new RedPackGiveRecordException(1, "红包创建失败");
|