| | |
| | | import com.ks.lucky.pojo.DTO.mq.ActivityStateChangeMsgDTO; |
| | | import com.ks.lucky.utils.LuckyCMQConstant; |
| | | import com.qcloud.cmq.Message; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.yeshi.utils.CMQUtil; |
| | | import org.yeshi.utils.JsonUtil; |
| | | |
| | |
| | | |
| | | public class CMQManager { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(CMQManager.class); |
| | | |
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25"; |
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo"; |
| | |
| | | */ |
| | | public void publishActivityStateChangeMsg(ActivityStateChangeMsgDTO dto) { |
| | | List<String> tagList = new ArrayList<>(); |
| | | tagList.add(LuckyCMQConstant.TAG_ACTIVITY_STATE_CHANGE); |
| | | cmqUtil.publishTopicMessage(LuckyCMQConstant.TOPIC_ACTIVITY_STATE_CHANGE, tagList, JsonUtil.getSimpleGson().toJson(dto)); |
| | | // tagList.add(LuckyCMQConstant.TAG_ACTIVITY_STATE_CHANGE); |
| | | cmqUtil.publishTopicMessage(LuckyCMQConstant.TOPIC_ACTIVITY_STATE_CHANGE, JsonUtil.getSimpleGson().toJson(dto)); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public void publishActivityAssistMsg(ActivityAssistMsgDTO dto) { |
| | | List<String> tagList = new ArrayList<>(); |
| | | tagList.add(LuckyCMQConstant.TAG_ASSIST); |
| | | cmqUtil.publishTopicMessage(LuckyCMQConstant.TOPIC_ASSIST, tagList, JsonUtil.getSimpleGson().toJson(dto)); |
| | | // tagList.add(LuckyCMQConstant.TAG_ASSIST); |
| | | String msgId = cmqUtil.publishTopicMessage(LuckyCMQConstant.TOPIC_ASSIST, JsonUtil.getSimpleGson().toJson(dto)); |
| | | logger.info("publishActivityJoinMsg:" + msgId); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param dto |
| | | */ |
| | | public void publishActivityDrawnMsg(ActivityDrawnMsgDTO dto) { |
| | | List<String> tagList = new ArrayList<>(); |
| | | tagList.add(LuckyCMQConstant.TAG_ACTIVITY_DRAWN); |
| | | cmqUtil.publishTopicMessage(LuckyCMQConstant.TOPIC_ACTIVITY_DRAWN, tagList, JsonUtil.getSimpleGson().toJson(dto)); |
| | | // List<String> tagList = new ArrayList<>(); |
| | | // tagList.add(LuckyCMQConstant.TAG_ACTIVITY_DRAWN); |
| | | String msgId = cmqUtil.publishTopicMessage(LuckyCMQConstant.TOPIC_ACTIVITY_DRAWN, JsonUtil.getSimpleGson().toJson(dto)); |
| | | logger.info("publishActivityDrawnMsg:" + msgId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 活动参与信息 |
| | | * |
| | | * @param dto |
| | | */ |
| | | public void publishActivityJoinMsg(ActivityJoinMsgDTO dto) { |
| | | List<String> tagList = new ArrayList<>(); |
| | | tagList.add(LuckyCMQConstant.TAG_ACTIVITY_JOIN); |
| | | cmqUtil.publishTopicMessage(LuckyCMQConstant.TOPIC_ACTIVITY_JOIN, tagList, JsonUtil.getSimpleGson().toJson(dto)); |
| | | // List<String> tagList = new ArrayList<>(); |
| | | // tagList.add(LuckyCMQConstant.TAG_ACTIVITY_JOIN); |
| | | String msgId = cmqUtil.publishTopicMessage(LuckyCMQConstant.TOPIC_ACTIVITY_JOIN, JsonUtil.getSimpleGson().toJson(dto)); |
| | | logger.info("publishActivityJoinMsg:" + msgId); |
| | | } |
| | | |
| | | } |