admin
2020-04-13 dd5b15229cb15459fa7c31ccea77dac28cbfafbd
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
package com.yeshi.fanli.util.factory.msg;
 
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
 
import com.google.gson.Gson;
import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail;
import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail.MsgTypeInviteTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
 
public class MsgInviteDetailFactory {
 
    /**
     * 直接粉丝邀请提醒
     * @param uid
     * @param nickName
     * @param portrait
     * @param time
     * @return
     */
    public static MsgInviteDetail directInviteSuccess(Long uid, String nickName, String portrait, Date time) {
        if (nickName == null || uid == null || portrait == null || time == null)
            return null;
        List<CommonMsgItemVO> listMsg = new ArrayList<>();
        List<ClientTextStyleVO> contentList = new ArrayList<>();
        contentList.add(new ClientTextStyleVO("恭喜你!团队增加直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO("",ClientTextStyleVO.COLOR_CONTENT, portrait));
        contentList.add(new ClientTextStyleVO("、" + nickName, ClientTextStyleVO.COLOR_CONTENT));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("直接粉丝", ClientTextStyleVO.COLOR_TITLE),contentList));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("加入时间", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO("无", ClientTextStyleVO.COLOR_CONTENT)));
        
        MsgInviteDetail detail = new MsgInviteDetail();
        detail.setCreateTime(new Date());
        detail.setMsgType(MsgTypeInviteTypeEnum.inviteSucceed);
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setExtraInfo(new Gson().toJson(listMsg));
        return detail;
    }
    
    /**
     * 间接邀请
     * @param uid
     * @param inviteName
     * @param nickName
     * @param portrait
     * @param time
     * @return
     */
    public static MsgInviteDetail indirectInviteSuccess(Long uid, String inviteName, String nickName, String portrait, Date time) {
        if (nickName == null || uid == null || portrait == null || time == null)
            return null;
        List<CommonMsgItemVO> listMsg = new ArrayList<>();
        List<ClientTextStyleVO> contentList = new ArrayList<>();
        contentList.add(new ClientTextStyleVO("恭喜你!团队增加直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO("",ClientTextStyleVO.COLOR_CONTENT, portrait));
        contentList.add(new ClientTextStyleVO("、" + nickName, ClientTextStyleVO.COLOR_CONTENT));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("间接粉丝", ClientTextStyleVO.COLOR_TITLE),contentList));
    
        List<ClientTextStyleVO> contentList2 = new ArrayList<>();
        contentList2.add(new ClientTextStyleVO("由直接粉丝", ClientTextStyleVO.COLOR_CONTENT));
        contentList2.add(new ClientTextStyleVO(inviteName,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
        contentList2.add(new ClientTextStyleVO("邀请", ClientTextStyleVO.COLOR_CONTENT));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("邀请人", ClientTextStyleVO.COLOR_TITLE),contentList2));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("加入时间", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO("无", ClientTextStyleVO.COLOR_CONTENT)));
        
        MsgInviteDetail detail = new MsgInviteDetail();
        detail.setCreateTime(new Date());
        detail.setMsgType(MsgTypeInviteTypeEnum.inviteSucceed);
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setExtraInfo(new Gson().toJson(listMsg));
        return detail;
    }
    
    
    /**
     * 粉丝升级
     * @param uid
     * @param rankName
     * @param nickName
     * @param item
     * @param time
     * @return
     */
    public static MsgInviteDetail fansUpgrade(Long uid, String relation, String rankName, String nickName, String item,   Date time) {
        if (nickName == null || uid == null || item == null || time == null)
            return null;
        List<CommonMsgItemVO> listMsg = new ArrayList<>();
        List<ClientTextStyleVO> contentList = new ArrayList<>();
        contentList.add(new ClientTextStyleVO("恭喜你!你的" + relation + ":", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO(nickName ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
        contentList.add(new ClientTextStyleVO("已升级为", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO(rankName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("升级说明", ClientTextStyleVO.COLOR_TITLE),contentList));
    
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("升级时间", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
        
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("升级方式", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(String.format("满足%s条件后完成的升级", item), ClientTextStyleVO.COLOR_CONTENT)));
        
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO("如有疑问请联系人工客服", ClientTextStyleVO.COLOR_CONTENT)));
        
        MsgInviteDetail detail = new MsgInviteDetail();
        detail.setCreateTime(new Date());
        detail.setMsgType(MsgTypeInviteTypeEnum.fansUpgrade);
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setExtraInfo(new Gson().toJson(listMsg));
        return detail;
    }
    
    
    /**
     * 直接粉丝脱离-开始脱离提醒
     * @param uid
     * @param rankName
     * @param nickName
     * @param item
     * @param time
     * @return
     */
    public static MsgInviteDetail fansPreDivorced(Long uid, String rankName, String nickName, String item, Date time) {
        if (nickName == null || uid == null || item == null || time == null)
            return null;
        List<CommonMsgItemVO> listMsg = new ArrayList<>();
        List<ClientTextStyleVO> contentList = new ArrayList<>();
        contentList.add(new ClientTextStyleVO("很抱歉!你的直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO(nickName ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
        contentList.add(new ClientTextStyleVO("已升级为", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO(rankName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离粉丝", ClientTextStyleVO.COLOR_TITLE),contentList));
    
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("升级时间", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
        
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离原因", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO("你还不是会员,即日起你需要在60天内升级为任意会员", ClientTextStyleVO.COLOR_CONTENT)));
        
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO("可在【\"我的-我的粉丝\"】中查看脱离剩余时间", ClientTextStyleVO.COLOR_CONTENT)));
        
        MsgInviteDetail detail = new MsgInviteDetail();
        detail.setCreateTime(new Date());
        detail.setMsgType(MsgTypeInviteTypeEnum.fansDivorced);
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setExtraInfo(new Gson().toJson(listMsg));
        return detail;
    }
    
    /**
     * 间接粉丝脱离-开始脱离提醒
     * @param uid
     * @param rankName
     * @param nickName
     * @param fansName
     * @param item
     * @param time
     * @return
     */
    public static MsgInviteDetail fansPredivorcedIndirect(Long uid, String rankName, String nickName, String fansName,
            String item, Date time) {
        if (nickName == null || uid == null || item == null || time == null)
            return null;
        
        List<CommonMsgItemVO> listMsg = new ArrayList<>();
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离粉丝", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(String.format("很抱歉!你的间接粉丝:%s已升级为%s", nickName, rankName), ClientTextStyleVO.COLOR_CONTENT)));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("升级时间", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
        
        List<ClientTextStyleVO> contentList = new ArrayList<>();
        contentList.add(new ClientTextStyleVO("你的直接粉丝", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO(fansName,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
        contentList.add(new ClientTextStyleVO("还不是会员,即日起你需要在60天内助力他成长为任意会员", ClientTextStyleVO.COLOR_CONTENT));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离原因", ClientTextStyleVO.COLOR_TITLE),contentList));
        
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO("可在【\"我的-我的粉丝\"】中查看脱离剩余时间", ClientTextStyleVO.COLOR_CONTENT)));
        
        MsgInviteDetail detail = new MsgInviteDetail();
        detail.setCreateTime(new Date());
        detail.setMsgType(MsgTypeInviteTypeEnum.fansDivorced);
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setExtraInfo(new Gson().toJson(listMsg));
        return detail;
    }
 
    /**
     * 直接粉丝脱离-已经脱离提醒
     * @param uid
     * @param rankName
     * @param nickName
     * @param item
     * @param time
     * @return
     */
    public static MsgInviteDetail fansDivorced(Long uid, String nickName, Date time) {
        if (nickName == null || uid == null || time == null)
            return null;
        List<CommonMsgItemVO> listMsg = new ArrayList<>();
        List<ClientTextStyleVO> contentList = new ArrayList<>();
        contentList.add(new ClientTextStyleVO("很抱歉!你的直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO(nickName ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
        contentList.add(new ClientTextStyleVO("已经脱离了你", ClientTextStyleVO.COLOR_CONTENT));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离粉丝", ClientTextStyleVO.COLOR_TITLE),contentList));
    
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离时间", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
        
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离原因", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO("你未能在60天内升级为任意会员", ClientTextStyleVO.COLOR_CONTENT)));
        
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO("如有疑问请联系人工客服", ClientTextStyleVO.COLOR_CONTENT)));
        
        MsgInviteDetail detail = new MsgInviteDetail();
        detail.setCreateTime(new Date());
        detail.setMsgType(MsgTypeInviteTypeEnum.fansDivorced);
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setExtraInfo(new Gson().toJson(listMsg));
        return detail;
    }
 
 
    /**
     * 直接粉丝脱离-已经脱离提醒
     * @param uid
     * @param rankName
     * @param nickName
     * @param item
     * @param time
     * @return
     */
    public static MsgInviteDetail fansDivorcedIndirect(Long uid, String nickName, String fansName, Date time) {
        if (nickName == null || uid == null || time == null)
            return null;
        List<CommonMsgItemVO> listMsg = new ArrayList<>();
        List<ClientTextStyleVO> contentList = new ArrayList<>();
        contentList.add(new ClientTextStyleVO("很抱歉!你的间接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO(nickName ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
        contentList.add(new ClientTextStyleVO("已经脱离了你", ClientTextStyleVO.COLOR_CONTENT));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离粉丝", ClientTextStyleVO.COLOR_TITLE),contentList));
    
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离时间", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
        
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离原因", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(String.format("你的直接粉丝%s未能在60天内升级为任意会员", fansName), ClientTextStyleVO.COLOR_CONTENT)));
        
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO("如有疑问请联系人工客服", ClientTextStyleVO.COLOR_CONTENT)));
        
        MsgInviteDetail detail = new MsgInviteDetail();
        detail.setCreateTime(new Date());
        detail.setMsgType(MsgTypeInviteTypeEnum.fansDivorced);
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setExtraInfo(new Gson().toJson(listMsg));
        return detail;
    }
    
}