From 30d8e227e8d823b6c38c3b9c90ac2df03b63befe Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 25 二月 2025 16:41:22 +0800 Subject: [PATCH] 淘宝转链接口更新 --- fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgInviteDetailFactory.java | 320 ++++++++++++++++++++++++++-------------------------- 1 files changed, 160 insertions(+), 160 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 2cbcb22..a637766 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 @@ -1,160 +1,160 @@ -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 org.yeshi.utils.TimeUtil; -import com.yeshi.common.vo.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, 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(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, 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))); - 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 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(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 inviteName - * @param nickName - * @param portrait - * @param time - * @return - */ - 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, 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))); - - MsgInviteDetail detail = new MsgInviteDetail(); - detail.setCreateTime(new Date()); - detail.setMsgType(MsgTypeInviteTypeEnum.pullNewRedPack); - detail.setRead(false); - detail.setUser(new UserInfo(uid)); - detail.setExtraInfo(new Gson().toJson(listMsg)); - return detail; - } - -} +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 org.yeshi.utils.TimeUtil; +import com.yeshi.common.vo.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, 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(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, 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))); + 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 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(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 inviteName + * @param nickName + * @param portrait + * @param time + * @return + */ + 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, 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))); + + MsgInviteDetail detail = new MsgInviteDetail(); + detail.setCreateTime(new Date()); + detail.setMsgType(MsgTypeInviteTypeEnum.pullNewRedPack); + detail.setRead(false); + detail.setUser(new UserInfo(uid)); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + +} -- Gitblit v1.8.0