SendlimitCodeMessageImpl.java
6.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package com.yoho.message.sdk.service.impl;
import com.yoho.message.sdk.common.constants.MiniAppTypeEnum;
import com.yoho.message.sdk.common.constants.PromotionScenes;
import com.yoho.message.sdk.common.handler.MessageCenterMqHandler;
import com.yoho.message.sdk.common.model.MessageCenterCommonEvent;
import com.yoho.message.sdk.common.model.SendMessageRspBo;
import com.yoho.message.sdk.service.AbstractSendMessage;
import com.yoho.message.sdk.service.ISendLimitCodeMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class SendlimitCodeMessageImpl extends AbstractSendMessage implements ISendLimitCodeMessage {
@Autowired
private MessageCenterMqHandler messageCenterMqHandler;
@Override
public SendMessageRspBo queueSuccess(String uid, int miniappType, String productName, String limitProductCode,int queueNumber,String releaseDateTime) {
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(PromotionScenes.LIMIT_CODE_QUEUE_SUCCESS,
String.valueOf(System.currentTimeMillis()), miniappType, uid);
messageCenterCommonEvent.putInParams("productName",productName);
messageCenterCommonEvent.putInParams("limitProductCode",limitProductCode);
messageCenterCommonEvent.putInParams("queueNumber",queueNumber);
messageCenterCommonEvent.putInParams("releaseDateTime",releaseDateTime);
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo prizeSuccess(String uid, int miniappType, String productName, String limitProductCode) {
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(PromotionScenes.LIMIT_CODE_PRIZE_SUCCESS,
String.valueOf(System.currentTimeMillis()), miniappType, uid);
messageCenterCommonEvent.putInParams("productName",productName);
messageCenterCommonEvent.putInParams("limitProductCode",limitProductCode);
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo prizeFail(String uid, int miniappType,String productName, String limitProductCode) {
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(PromotionScenes.LIMIT_CODE_PRIZE_FAIL,
String.valueOf(System.currentTimeMillis()), miniappType, uid);
messageCenterCommonEvent.putInParams("productName",productName);
messageCenterCommonEvent.putInParams("limitProductCode",limitProductCode);
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo helpProcess(String uid, int miniappType,String productName, String limitProductCode) {
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(PromotionScenes.LIMIT_CODE_HELP_PROCESS,
String.valueOf(System.currentTimeMillis()), miniappType, uid);
messageCenterCommonEvent.putInParams("productName",productName);
messageCenterCommonEvent.putInParams("limitProductCode",limitProductCode);
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
/**
* 好友助力成功当天提醒
* @param uid
* @param productName 商品名称
* @param currentAssitNum 当前助力人数
* @param limitProductCode 限购码
* @return
*/
public SendMessageRspBo assitSuccess(String uid, String productName, int currentAssitNum, String limitProductCode){
MessageCenterCommonEvent centerCommonEvent = genMessageCenterCommonEvent(PromotionScenes.ASSIT_SUCCESS_NOTICE,String.valueOf(System.currentTimeMillis()),uid);
centerCommonEvent.putInParams("productName",productName);
centerCommonEvent.putInParams("currentAssitNum",currentAssitNum);
centerCommonEvent.putInParams("limitProductCode",limitProductCode);
messageCenterMqHandler.sendMessageToMq(centerCommonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
/**
* 成功获得限购码当天提醒
* @param uid
* @param productName 商品名称
* @param releaseDateTime 发售时间 yyyy-MM-dd HH:mm
* @param limitProductCode 限购码
* @return
*/
public SendMessageRspBo getLimitCodeSuccess(String uid, String productName, String releaseDateTime, String limitProductCode){
MessageCenterCommonEvent centerCommonEvent = genMessageCenterCommonEvent(PromotionScenes.GET_LIMITCODE_SUCCESS,String.valueOf(System.currentTimeMillis()),uid);
centerCommonEvent.putInParams("productName",productName);
centerCommonEvent.putInParams("releaseDateTime",releaseDateTime);
centerCommonEvent.putInParams("limitProductCode",limitProductCode);
messageCenterMqHandler.sendMessageToMq(centerCommonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
/**
* 获取限购码的用户开售当天提醒
* @param uid
* @param mobile 购买者手机号(中间四位*代替)
* @param productName 商品名称
* @param productPrice 商品价格
* @param sellStartTime 发售时间(yyyy-MM-dd HH:mm)
* @param productSkn 商品skn
* @return
*/
public SendMessageRspBo limitProductSellStart(String uid,String mobile,String productName,String productPrice,String sellStartTime,String productSkn){
MessageCenterCommonEvent centerCommonEvent = genMessageCenterCommonEvent(PromotionScenes.LIMIT_PRODUCT_SELL_START,
String.valueOf(System.currentTimeMillis()), MiniAppTypeEnum.LIMIT_SELL.getCode(), uid);
centerCommonEvent.putInParams("mobile",mobile);
centerCommonEvent.putInParams("productName",productName);
centerCommonEvent.putInParams("productPrice",productPrice);
centerCommonEvent.putInParams("sellStartTime",sellStartTime);
centerCommonEvent.putInParams("productSkn",productSkn);
messageCenterMqHandler.sendMessageToMq(centerCommonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
}