From 2147d023563a7c9d05d97547c00d6b0162c0644c Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 09 十一月 2020 18:37:24 +0800 Subject: [PATCH] 刷单风险规则优化 --- fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgInviteDetailFactory.java | 169 ++++++++------------------------------------------------ 1 files changed, 25 insertions(+), 144 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgInviteDetailFactory.java b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgInviteDetailFactory.java index e4450be..2cbcb22 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgInviteDetailFactory.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgInviteDetailFactory.java @@ -8,8 +8,8 @@ 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 org.yeshi.utils.TimeUtil; +import com.yeshi.common.vo.ClientTextStyleVO; import com.yeshi.fanli.vo.msg.CommonMsgItemVO; import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory; @@ -28,10 +28,11 @@ 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)); + 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("鐩存帴绮変笣", ClientTextStyleVO.COLOR_CONTENT))); 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), @@ -60,11 +61,11 @@ 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)); - + 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("闂存帴绮変笣", ClientTextStyleVO.COLOR_CONTENT))); List<ClientTextStyleVO> contentList2 = new ArrayList<>(); contentList2.add(new ClientTextStyleVO("鐢辩洿鎺ョ矇涓�", ClientTextStyleVO.COLOR_CONTENT)); contentList2.add(new ClientTextStyleVO(inviteName,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); @@ -94,12 +95,12 @@ * @param time * @return */ - public static MsgInviteDetail fansUpgrade(Long uid, String relation, String rankName, String nickName, String item, Date time) { + public static MsgInviteDetail fansUpgrade(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("鎭枩浣狅紒浣犵殑" + relation + ":", ClientTextStyleVO.COLOR_CONTENT)); + 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)); @@ -125,151 +126,31 @@ /** - * 鐩存帴绮変笣鑴辩-寮�濮嬭劚绂绘彁閱� + * 闂存帴閭�璇� * @param uid - * @param rankName + * @param inviteName * @param nickName - * @param item + * @param portrait * @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) + public static MsgInviteDetail pullNewRedPack(Long uid, String nickName, String portrait) { + if (nickName == null || uid == null || portrait == 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))); - + 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("鐩存帴绮変笣", ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("淇℃伅缁存姢", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("璇ョ矇涓濆畬鎴愪簡浣犵殑鎷夋柊濂栧姳璁㈠崟锛屾媺鏂板鍔辩孩鍖呬細鍦ㄨ璁㈠崟纭鏀惰揣鍚庣殑娆℃湀26鏃ュ埌璐�", ClientTextStyleVO.COLOR_CONTENT))); listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO("鍙湪銆怽"鎴戠殑-鎴戠殑绮変笣\"銆戜腑鏌ョ湅鑴辩鍓╀綑鏃堕棿", ClientTextStyleVO.COLOR_CONTENT))); + 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.setMsgType(MsgTypeInviteTypeEnum.pullNewRedPack); detail.setRead(false); detail.setUser(new UserInfo(uid)); detail.setExtraInfo(new Gson().toJson(listMsg)); -- Gitblit v1.8.0