AbstractSendMessage.java
1.97 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
package com.yoho.message.sdk.service;
import java.util.Arrays;
import java.util.List;
import com.yoho.message.sdk.common.model.MessageCenterCommonEvent;
/**
*
* <Description> 通用类<br>
*
* @author amos.shan<br>
* @version 1.0<br>
* @taskId <br>
* @CreateDate 2016年12月22日 <br>
*/
public abstract class AbstractSendMessage {
public static final int PAGE_SIZE = 1000;
public MessageCenterCommonEvent genMessageCenterCommonEvent(String sendScene, String sendSceneKey, String uid) {
List<String> uids = Arrays.asList(uid);
return new MessageCenterCommonEvent(sendScene, sendSceneKey, uids);
}
public MessageCenterCommonEvent genMessageCenterCommonEventPublicCode(String sendScene, String sendSceneKey,int publicNumberCode, String uid) {
List<String> uids = Arrays.asList(uid);
MessageCenterCommonEvent messageCenterCommonEvent = new MessageCenterCommonEvent(sendScene, sendSceneKey, uids);
messageCenterCommonEvent.setPublicNumberCode(publicNumberCode);
return messageCenterCommonEvent;
}
public MessageCenterCommonEvent genMessageCenterCommonEvent(String sendScene, String sendSceneKey, int miniappType, String uid) {
List<String> uids = Arrays.asList(uid);
// 原来用 miniappFlg = 1 or 0 来标识是否是小程序
// 为了支持多小程序,miniappType (miniappFlg=1 实际上是 miniappType=0的小程序)
// 其他的 miniappFlg = miniappType
if (miniappType == 1){
miniappType = 0;
}
return new MessageCenterCommonEvent(sendScene, sendSceneKey, miniappType, uids);
}
public MessageCenterCommonEvent genMessageCenterCommonEvent(String sendScene, String sendSceneKey, int miniappType, List<String> uids) {
// 原来用 miniappFlg = 1 or 0 来标识是否是小程序
// 为了支持多小程序,miniappType (miniappFlg=1 实际上是 miniappType=0的小程序)
// 其他的 miniappFlg = miniappType
if (miniappType == 1){
miniappType = 0;
}
return new MessageCenterCommonEvent(sendScene, sendSceneKey, miniappType, uids);
}
}