| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.scheduling.annotation.Async;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudGoodsService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudManageService;
|
| | | import com.yeshi.fanli.service.manger.msg.RocketMQManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
|
| | |
| | | @Resource
|
| | | private UserCloudManageService userCloudManageService;
|
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | | @Resource
|
| | | private RocketMQManager rocketMQManager;
|
| | |
|
| | | @Override
|
| | | public void deleteByPrimaryKeyAndUid(Long id, Long uid) {
|
| | |
| | | return result;
|
| | | }
|
| | |
|
| | | @Async
|
| | | @Override
|
| | | public void sendGoodsMQMsg(Long uid) {
|
| | | if (Constant.IS_TEST) {
|
| | |
| | | UserCloudMQMsg msg = new UserCloudMQMsg(uid, cloudGoods.getId() + "", UserCloudMQMsg.TYPE_STORE);
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userCloud, msg);
|
| | | message.setStartDeliverTime(deliverTime);
|
| | | producer.send(message);
|
| | | rocketMQManager.sendNormalMsg(message, null);
|
| | | // 每5分钟查询一次
|
| | | deliverTime = deliverTime + 1000 * 60 * 5;
|
| | | }
|