From 8ce7c720e4e7a604b0ff770349b5556f39d37759 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 13 九月 2021 11:44:38 +0800 Subject: [PATCH] 好省呗应用兼容 --- fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgAccountDetailFactory.java | 999 +++++++++++++++++++++++++++++----------------------------- 1 files changed, 500 insertions(+), 499 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgAccountDetailFactory.java b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgAccountDetailFactory.java index 270943b..1dc91bc 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgAccountDetailFactory.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgAccountDetailFactory.java @@ -1,499 +1,500 @@ -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.MsgAccountDetail; -import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail.MsgTypeAccountTypeEnum; -import com.yeshi.fanli.entity.bus.user.UserInfo; -import com.yeshi.fanli.util.StringUtil; -import com.yeshi.common.vo.ClientTextStyleVO; -import com.yeshi.fanli.vo.msg.CommonMsgItemVO; -import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory; - -public class MsgAccountDetailFactory { - public final static int TYPE_WX = 1;// 寰俊 - public final static int TYPE_TB = 2;// 娣樺疂 - public final static int TYPE_PHONE = 3;// 鐢佃瘽 - - public final static int WAY_BIND = 1;// 缁戝畾 - public final static int WAY_CHANGE = 2;// 鏇存崲 - public final static int WAY_UNBIND = 3;// 瑙g粦 - - /** - * 璐﹀彿缁戝畾鎴愬姛 - * - * @param uid - * @param type - * @return - */ - public static MsgAccountDetail createBindSuccess(Long uid, int type, int changeWay) { - if (uid == null) - return null; - - String info = ""; - String typeName = ""; - if (type == TYPE_PHONE) { - info = "鎵嬫満鍙风爜"; - typeName = "鎵嬫満鍙�"; - } else if (type == TYPE_TB) { - info = "娣樺疂璐﹀彿"; - typeName = "娣樺疂璐﹀彿"; - } else if (type == TYPE_WX) { - info = "寰俊璐﹀彿"; - typeName = "寰俊鍙�"; - } - - String way = ""; - if (changeWay == WAY_BIND) { - way = "缁戝畾鎴愬姛"; - } else if (changeWay == WAY_CHANGE) { - way = "鏇存崲鎴愬姛"; - } else if (changeWay == WAY_UNBIND) { - way = "瑙g粦鎴愬姛"; - } - - String beizu = "鏃�"; - if (type == TYPE_TB && changeWay == WAY_CHANGE) { - beizu = "娣樺疂璐﹀彿鏇存崲缁戝畾鍚庯紝璇峰姟蹇呰鐢ㄦ洿鎹㈠悗鐨勬窐瀹濊处鍙烽鍒镐笅鍗�"; - } - - List<CommonMsgItemVO> listMsg = new ArrayList<>(); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("缁戝畾璇︽儏", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO("鎭枩浣狅紒" + info + "-" + way, ClientTextStyleVO.COLOR_CONTENT))); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("缁戝畾璐﹀彿", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO(typeName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT))); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO(beizu, ClientTextStyleVO.COLOR_CONTENT))); - - MsgAccountDetail detail = new MsgAccountDetail(); - detail.setTitle("缁戝畾璐﹀彿"); - detail.setType(MsgTypeAccountTypeEnum.bingding); - detail.setUser(new UserInfo(uid)); - detail.setCreateTime(new Date()); - detail.setRead(false); - detail.setExtraInfo(new Gson().toJson(listMsg)); - return detail; - } - - /** - * 璐﹀彿缁戝畾澶辫触 - * - * @param uid - * @param type - * @return - */ - public static MsgAccountDetail createBindFail(Long uid, int type, int changeWay, String reason) { - if (uid == null) - return null; - - String info = ""; - String typeName = ""; - if (type == TYPE_PHONE) { - info = "鎵嬫満鍙风爜"; - typeName = "鎵嬫満鍙�"; - } else if (type == TYPE_TB) { - info = "娣樺疂璐﹀彿"; - typeName = "娣樺疂璐﹀彿"; - } else if (type == TYPE_WX) { - info = "寰俊璐﹀彿"; - typeName = "寰俊鍙�"; - } - - String way = ""; - if (changeWay == WAY_BIND) { - way = "缁戝畾澶辫触"; - } else if (changeWay == WAY_CHANGE) { - way = "鏇存崲澶辫触"; - } else if (changeWay == WAY_UNBIND) { - way = "瑙g粦澶辫触"; - } - - List<CommonMsgItemVO> listMsg = new ArrayList<>(); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("缁戝畾璇︽儏", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO("寰堟姳姝夛紒" + info + "-" + way, ClientTextStyleVO.COLOR_CONTENT))); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("缁戝畾璐﹀彿", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO(typeName, ClientTextStyleVO.COLOR_CONTENT))); - if (!StringUtil.isNullOrEmpty(reason)) { - listMsg.add( - CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶辫触鍘熷洜", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO(reason, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT))); - } - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO("鏃�", ClientTextStyleVO.COLOR_CONTENT))); - - MsgAccountDetail detail = new MsgAccountDetail(); - detail.setTitle("缁戝畾璐﹀彿"); - detail.setType(MsgTypeAccountTypeEnum.bingding); - detail.setUser(new UserInfo(uid)); - detail.setCreateTime(new Date()); - detail.setRead(false); - detail.setExtraInfo(new Gson().toJson(listMsg)); - return detail; - } - - /** - * 閭�璇风爜淇敼 - * @param uid - * @param oldCode - * @param newCode - * @return - */ - public static MsgAccountDetail createChangeInviteCode(Long uid, String oldCode, String newCode) { - if (uid == null || StringUtil.isNullOrEmpty(oldCode) || StringUtil.isNullOrEmpty(newCode)) - return null; - - List<CommonMsgItemVO> listMsg = new ArrayList<>(); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("淇敼绫诲埆", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO("閭�璇风爜淇敼", ClientTextStyleVO.COLOR_CONTENT))); - - List<ClientTextStyleVO> contentList2 = new ArrayList<>(); - contentList2.add(new ClientTextStyleVO(String.format("浣犲師閭�璇风爜:%s 宸茬粡鎴愬姛淇敼涓烘柊閭�璇风爜:", oldCode), - ClientTextStyleVO.COLOR_CONTENT)); - contentList2.add(new ClientTextStyleVO(newCode, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("淇敼璇︽儏", ClientTextStyleVO.COLOR_TITLE), - contentList2)); - - List<ClientTextStyleVO> contentList3 = new ArrayList<>(); - contentList3.add(new ClientTextStyleVO("鍘熼個璇风爜渚濈劧鍙互浣跨敤", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); - contentList3.add(new ClientTextStyleVO("锛屾瘡涓处鎴稩D浠呰兘淇敼涓�娆�", ClientTextStyleVO.COLOR_CONTENT)); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("閲嶈鎻愰啋", ClientTextStyleVO.COLOR_TITLE), - contentList3)); - - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO("鏃�", ClientTextStyleVO.COLOR_CONTENT))); - - MsgAccountDetail detail = new MsgAccountDetail(); - detail.setTitle("缁戝畾璐﹀彿"); - detail.setType(MsgTypeAccountTypeEnum.changeCode); - detail.setUser(new UserInfo(uid)); - detail.setCreateTime(new Date()); - detail.setRead(false); - detail.setExtraInfo(new Gson().toJson(listMsg)); - return detail; - } - - // artificial - - /** - * 浜哄伐鍗囩骇浼氬憳娑堟伅 - * @Title: artificialVipPreUpgradeSuccess - * @Description: - * @param uid - * @param originalName - * @param upName - * @param days - * @return - * MsgAccountDetail 杩斿洖绫诲瀷 - * @throws - */ - public static MsgAccountDetail artificialVipUpgradeSuccess(Long uid, String originalName, String upName, int days) { - if (uid == null || originalName == null || upName == null) - return null; - - List<CommonMsgItemVO> listMsg = new ArrayList<>(); - - List<ClientTextStyleVO> contentList2 = new ArrayList<>(); - contentList2.add(new ClientTextStyleVO("浣犵殑璐︽埛宸茬敱" + originalName + "鍗囩骇涓�", ClientTextStyleVO.COLOR_CONTENT)); - contentList2.add(new ClientTextStyleVO(upName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎴愰暱璇︽儏", ClientTextStyleVO.COLOR_TITLE), - contentList2)); - - List<ClientTextStyleVO> contentList3 = new ArrayList<>(); - contentList3.add(new ClientTextStyleVO(days + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); - contentList3.add(new ClientTextStyleVO("澶�", ClientTextStyleVO.COLOR_CONTENT)); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍏辫�楁椂", ClientTextStyleVO.COLOR_TITLE), - contentList3)); - - 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("鏃�", ClientTextStyleVO.COLOR_CONTENT))); - - MsgAccountDetail detail = new MsgAccountDetail(); - detail.setTitle("绛夌骇鎴愰暱"); - detail.setType(MsgTypeAccountTypeEnum.vipPgrade); - detail.setUser(new UserInfo(uid)); - detail.setCreateTime(new Date()); - detail.setRead(false); - detail.setExtraInfo(new Gson().toJson(listMsg)); - return detail; - } - - /** - * 浜哄伐鍗囩骇浼氬憳娑堟伅澶辫触 - * @Title: artificialVipUpgradeFail - * @Description: - * @param uid - * @param originalName - * @param upName - * @param reson - * @return - * MsgAccountDetail 杩斿洖绫诲瀷 - * @throws - */ - public static MsgAccountDetail artificialVipUpgradeFail(Long uid, String originalName, String upName, - String reson) { - if (uid == null || originalName == null || upName == null) - return null; - - List<CommonMsgItemVO> listMsg = new ArrayList<>(); - - List<ClientTextStyleVO> contentList = new ArrayList<>(); - contentList.add(new ClientTextStyleVO("寰堟姳姝夛紒鏈�氳繃浜哄伐瀹℃牳 ", ClientTextStyleVO.COLOR_CONTENT)); - - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎴愰暱璇存槑", ClientTextStyleVO.COLOR_TITLE), - contentList)); - - List<ClientTextStyleVO> contentList2 = new ArrayList<>(); - contentList2.add(new ClientTextStyleVO("浣犵殑璐︽埛浠嶆槸" + originalName, ClientTextStyleVO.COLOR_CONTENT)); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎴愰暱璇︽儏", ClientTextStyleVO.COLOR_TITLE), - contentList2)); - - List<ClientTextStyleVO> contentList3 = new ArrayList<>(); - contentList3.add(new ClientTextStyleVO(reson, ClientTextStyleVO.COLOR_CONTENT)); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎷掔粷鍘熷洜", ClientTextStyleVO.COLOR_TITLE), - contentList3)); - - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO("濡傛湁鐤戦棶璇疯仈绯讳汉宸ュ鏈�", ClientTextStyleVO.COLOR_CONTENT))); - - MsgAccountDetail detail = new MsgAccountDetail(); - detail.setTitle("绛夌骇鎴愰暱"); - detail.setType(MsgTypeAccountTypeEnum.vipPgrade); - detail.setUser(new UserInfo(uid)); - detail.setCreateTime(new Date()); - detail.setRead(false); - detail.setExtraInfo(new Gson().toJson(listMsg)); - return detail; - } - - /** - * 鏅�氫細鍛樸�侀珮绾т細鍛樿嚜鍔ㄦ彁鍗� - * @param uid - * @param originalName - * @param upName - * @param days - * @param targetNum1 - * @param type - * @param targetNum2 - * @param beizu - * @return - */ - public static MsgAccountDetail vipPreUpgrade(Long uid, String originalName, String upName, int days, - long targetNum1, Long targetNum2, boolean teamPass) { - if (uid == null || originalName == null || upName == null) - return null; - - List<CommonMsgItemVO> listMsg = new ArrayList<>(); - List<ClientTextStyleVO> contentList = new ArrayList<>(); - contentList.add(new ClientTextStyleVO("鎭枩浣狅紒鏈夋晥", ClientTextStyleVO.COLOR_CONTENT)); - if (teamPass) { - contentList.add(new ClientTextStyleVO("鐩存帴绮変笣宸茶揪", ClientTextStyleVO.COLOR_CONTENT)); - contentList.add(new ClientTextStyleVO(targetNum1 + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); - contentList.add(new ClientTextStyleVO("浜猴紝鏈夋晥闂存帴绮変笣宸茶揪", ClientTextStyleVO.COLOR_CONTENT)); - contentList.add(new ClientTextStyleVO(targetNum2 + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); - contentList.add(new ClientTextStyleVO("浜�", ClientTextStyleVO.COLOR_CONTENT)); - } else { - contentList.add(new ClientTextStyleVO("杩斿埄+鍒嗕韩璁㈠崟宸茶揪", ClientTextStyleVO.COLOR_CONTENT)); - contentList.add(new ClientTextStyleVO(targetNum1 + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); - contentList.add(new ClientTextStyleVO("绗�", ClientTextStyleVO.COLOR_CONTENT)); - } - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎴愰暱璇存槑", ClientTextStyleVO.COLOR_TITLE), - contentList)); - - List<ClientTextStyleVO> contentList2 = new ArrayList<>(); - contentList2.add(new ClientTextStyleVO("浣犵殑璐︽埛宸茬敱" + originalName + "鍗囩骇涓�", ClientTextStyleVO.COLOR_CONTENT)); - contentList2.add(new ClientTextStyleVO(upName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎴愰暱璇︽儏", ClientTextStyleVO.COLOR_TITLE), - contentList2)); - - List<ClientTextStyleVO> contentList3 = new ArrayList<>(); - contentList3.add(new ClientTextStyleVO(days + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); - contentList3.add(new ClientTextStyleVO("澶�", ClientTextStyleVO.COLOR_CONTENT)); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍏辫�楁椂", ClientTextStyleVO.COLOR_TITLE), - contentList3)); - - 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("鏃�", ClientTextStyleVO.COLOR_CONTENT))); - - MsgAccountDetail detail = new MsgAccountDetail(); - detail.setTitle("绛夌骇鎴愰暱"); - detail.setType(MsgTypeAccountTypeEnum.vipPgrade); - detail.setUser(new UserInfo(uid)); - detail.setCreateTime(new Date()); - detail.setRead(false); - detail.setExtraInfo(new Gson().toJson(listMsg)); - return detail; - } - - /** - * 鏅�氫細鍛樸�侀珮绾т細鍛樿嚜鍔ㄦ彁鍗� - * @param uid - * @param originalName - * @param upName - * @param days - * @param targetNum1 - * @param type - * @param targetNum2 - * @param beizu - * @return - */ - public static MsgAccountDetail vipUpgradeSuccess(Long uid, int days) { - if (uid == null) - return null; - - List<CommonMsgItemVO> listMsg = new ArrayList<>(); - 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("瓒呯骇浼氬憳", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎴愰暱璇︽儏", ClientTextStyleVO.COLOR_TITLE), - contentList2)); - - List<ClientTextStyleVO> contentList3 = new ArrayList<>(); - contentList3.add(new ClientTextStyleVO(days + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); - contentList3.add(new ClientTextStyleVO("澶�", ClientTextStyleVO.COLOR_CONTENT)); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍏辫�楁椂", ClientTextStyleVO.COLOR_TITLE), - contentList3)); - - 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("鎰熸仼鍔姏鐨勮嚜宸憋紝璁╂垜浠惡鎵嬫澘鏍楀揩鐪佷竴璧锋垚闀�", ClientTextStyleVO.COLOR_CONTENT))); - - MsgAccountDetail detail = new MsgAccountDetail(); - detail.setTitle("绛夌骇鎴愰暱"); - detail.setType(MsgTypeAccountTypeEnum.vipPgrade); - detail.setUser(new UserInfo(uid)); - detail.setCreateTime(new Date()); - detail.setRead(false); - detail.setExtraInfo(new Gson().toJson(listMsg)); - return detail; - } - - /** - * 鏅�氫細鍛樸�侀珮绾т細鍛樿嚜鍔ㄦ彁鍗� - * @param uid - * @param originalName - * @param upName - * @param days - * @param targetNum1 - * @param type - * @param targetNum2 - * @param beizu - * @return - */ - public static MsgAccountDetail vipUpgradeFail(Long uid, String reason) { - if (uid == null) - return null; - - List<CommonMsgItemVO> listMsg = new ArrayList<>(); - 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("浣犵殑璐︽埛浠嶆槸楂樼骇浼氬憳", ClientTextStyleVO.COLOR_CONTENT))); - - if (!StringUtil.isNullOrEmpty(reason)) { - listMsg.add( - CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎷掔粷鍘熷洜", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO(reason, ClientTextStyleVO.COLOR_CONTENT))); - } - - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO("濡傛湁鐤戦棶璇疯仈绯讳汉宸ュ鏈�", ClientTextStyleVO.COLOR_CONTENT))); - - MsgAccountDetail detail = new MsgAccountDetail(); - detail.setTitle("绛夌骇鎴愰暱"); - detail.setType(MsgTypeAccountTypeEnum.vipPgrade); - detail.setUser(new UserInfo(uid)); - detail.setCreateTime(new Date()); - detail.setRead(false); - detail.setExtraInfo(new Gson().toJson(listMsg)); - return detail; - } - - /** - * 璧勬繁瀵煎笀--杩愯惀鍙戝嚭閭�绾� - * @param uid - * @param nickname - * @param kefuName - * @param kefuWX - * @return - */ - public static MsgAccountDetail teacherInvite(Long uid, String nickname, String kefuName, String kefuWX) { - if (uid == null) - return null; - - List<CommonMsgItemVO> listMsg = new ArrayList<>(); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("閭�绾﹀師鍥�", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO("灏婃暚鐨�" + nickname + "锛屼綘宸茬鍚堟垚闀夸负涓�鍚嶈祫娣卞甯堢殑鏉′欢锛屽笇鏈涗綘鑳藉姞鍏ユ澘鏍楀揩鐪佽繍钀ュ洟闃燂紝涓庢垜浠叡鍒涜緣鐓�", - ClientTextStyleVO.COLOR_CONTENT))); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("涓撳睘瀹㈡湇", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO(kefuName + "-寰俊鍙�:" + kefuWX, ClientTextStyleVO.COLOR_CONTENT))); - 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("璧勬繁瀵煎笀璧勬牸闇�瑕佸悗鍙版墜鍔ㄥ紑閫氾紝璇峰姟蹇呰仈绯讳笓灞炲鏈�", ClientTextStyleVO.COLOR_CONTENT))); - - MsgAccountDetail detail = new MsgAccountDetail(); - detail.setTitle("绛夌骇鎴愰暱"); - detail.setType(MsgTypeAccountTypeEnum.vipPgrade); - detail.setUser(new UserInfo(uid)); - detail.setCreateTime(new Date()); - detail.setRead(false); - detail.setExtraInfo(new Gson().toJson(listMsg)); - return detail; - } - - /** - * 璧勬繁瀵煎笀--杩愯惀鍙戝嚭閭�绾� - * @param uid - * @param nickname - * @param kefuName - * @param kefuWX - * @return - */ - public static MsgAccountDetail teacherSuccess(Long uid, int days, String kefuName, String kefuWX) { - if (uid == 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_HIGHLIGHT_CONTENT)); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎴愰暱璇︽儏", ClientTextStyleVO.COLOR_TITLE), - contentList)); - - List<ClientTextStyleVO> contentList2 = new ArrayList<>(); - contentList2.add(new ClientTextStyleVO(days + "", 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("浠庢敹鍒版湰娑堟伅璧凤紝浣犲皢鑾峰緱璇ヨ处鎴风瓑绾у搴旂殑鍏ㄩ儴鏉冪泭", ClientTextStyleVO.COLOR_CONTENT))); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("涓撳睘瀹㈡湇", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO(kefuName + "-寰俊鍙�:" + kefuWX, ClientTextStyleVO.COLOR_CONTENT))); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO("涓庝綘鍏卞垱杈夌厡", ClientTextStyleVO.COLOR_CONTENT))); - - MsgAccountDetail detail = new MsgAccountDetail(); - detail.setTitle("绛夌骇鎴愰暱"); - detail.setType(MsgTypeAccountTypeEnum.vipPgrade); - detail.setUser(new UserInfo(uid)); - detail.setCreateTime(new Date()); - detail.setRead(false); - 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.MsgAccountDetail; +import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail.MsgTypeAccountTypeEnum; +import com.yeshi.fanli.entity.bus.user.UserInfo; +import com.yeshi.fanli.util.StringUtil; +import com.yeshi.common.vo.ClientTextStyleVO; +import com.yeshi.fanli.vo.msg.CommonMsgItemVO; +import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory; + +public class MsgAccountDetailFactory { + public final static int TYPE_WX = 1;// 寰俊 + public final static int TYPE_TB = 2;// 娣樺疂 + public final static int TYPE_PHONE = 3;// 鐢佃瘽 + public final static int TYPE_QQ = 4;// 鐢佃瘽 + + public final static int WAY_BIND = 1;// 缁戝畾 + public final static int WAY_CHANGE = 2;// 鏇存崲 + public final static int WAY_UNBIND = 3;// 瑙g粦 + + /** + * 璐﹀彿缁戝畾鎴愬姛 + * + * @param uid + * @param type + * @return + */ + public static MsgAccountDetail createBindSuccess(Long uid, int type, int changeWay) { + if (uid == null) + return null; + + String info = ""; + String typeName = ""; + if (type == TYPE_PHONE) { + info = "鎵嬫満鍙风爜"; + typeName = "鎵嬫満鍙�"; + } else if (type == TYPE_TB) { + info = "娣樺疂璐﹀彿"; + typeName = "娣樺疂璐﹀彿"; + } else if (type == TYPE_WX) { + info = "寰俊璐﹀彿"; + typeName = "寰俊鍙�"; + } + + String way = ""; + if (changeWay == WAY_BIND) { + way = "缁戝畾鎴愬姛"; + } else if (changeWay == WAY_CHANGE) { + way = "鏇存崲鎴愬姛"; + } else if (changeWay == WAY_UNBIND) { + way = "瑙g粦鎴愬姛"; + } + + String beizu = "鏃�"; + if (type == TYPE_TB && changeWay == WAY_CHANGE) { + beizu = "娣樺疂璐﹀彿鏇存崲缁戝畾鍚庯紝璇峰姟蹇呰鐢ㄦ洿鎹㈠悗鐨勬窐瀹濊处鍙烽鍒镐笅鍗�"; + } + + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("缁戝畾璇︽儏", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("鎭枩浣狅紒" + info + "-" + way, ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("缁戝畾璐﹀彿", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(typeName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(beizu, ClientTextStyleVO.COLOR_CONTENT))); + + MsgAccountDetail detail = new MsgAccountDetail(); + detail.setTitle("缁戝畾璐﹀彿"); + detail.setType(MsgTypeAccountTypeEnum.bingding); + detail.setUser(new UserInfo(uid)); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + + /** + * 璐﹀彿缁戝畾澶辫触 + * + * @param uid + * @param type + * @return + */ + public static MsgAccountDetail createBindFail(Long uid, int type, int changeWay, String reason) { + if (uid == null) + return null; + + String info = ""; + String typeName = ""; + if (type == TYPE_PHONE) { + info = "鎵嬫満鍙风爜"; + typeName = "鎵嬫満鍙�"; + } else if (type == TYPE_TB) { + info = "娣樺疂璐﹀彿"; + typeName = "娣樺疂璐﹀彿"; + } else if (type == TYPE_WX) { + info = "寰俊璐﹀彿"; + typeName = "寰俊鍙�"; + } + + String way = ""; + if (changeWay == WAY_BIND) { + way = "缁戝畾澶辫触"; + } else if (changeWay == WAY_CHANGE) { + way = "鏇存崲澶辫触"; + } else if (changeWay == WAY_UNBIND) { + way = "瑙g粦澶辫触"; + } + + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("缁戝畾璇︽儏", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("寰堟姳姝夛紒" + info + "-" + way, ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("缁戝畾璐﹀彿", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(typeName, ClientTextStyleVO.COLOR_CONTENT))); + if (!StringUtil.isNullOrEmpty(reason)) { + listMsg.add( + CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶辫触鍘熷洜", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(reason, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT))); + } + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("鏃�", ClientTextStyleVO.COLOR_CONTENT))); + + MsgAccountDetail detail = new MsgAccountDetail(); + detail.setTitle("缁戝畾璐﹀彿"); + detail.setType(MsgTypeAccountTypeEnum.bingding); + detail.setUser(new UserInfo(uid)); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + + /** + * 閭�璇风爜淇敼 + * @param uid + * @param oldCode + * @param newCode + * @return + */ + public static MsgAccountDetail createChangeInviteCode(Long uid, String oldCode, String newCode) { + if (uid == null || StringUtil.isNullOrEmpty(oldCode) || StringUtil.isNullOrEmpty(newCode)) + return null; + + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("淇敼绫诲埆", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("閭�璇风爜淇敼", ClientTextStyleVO.COLOR_CONTENT))); + + List<ClientTextStyleVO> contentList2 = new ArrayList<>(); + contentList2.add(new ClientTextStyleVO(String.format("浣犲師閭�璇风爜:%s 宸茬粡鎴愬姛淇敼涓烘柊閭�璇风爜:", oldCode), + ClientTextStyleVO.COLOR_CONTENT)); + contentList2.add(new ClientTextStyleVO(newCode, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("淇敼璇︽儏", ClientTextStyleVO.COLOR_TITLE), + contentList2)); + + List<ClientTextStyleVO> contentList3 = new ArrayList<>(); + contentList3.add(new ClientTextStyleVO("鍘熼個璇风爜渚濈劧鍙互浣跨敤", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList3.add(new ClientTextStyleVO("锛屾瘡涓处鎴稩D浠呰兘淇敼涓�娆�", ClientTextStyleVO.COLOR_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("閲嶈鎻愰啋", ClientTextStyleVO.COLOR_TITLE), + contentList3)); + + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("鏃�", ClientTextStyleVO.COLOR_CONTENT))); + + MsgAccountDetail detail = new MsgAccountDetail(); + detail.setTitle("缁戝畾璐﹀彿"); + detail.setType(MsgTypeAccountTypeEnum.changeCode); + detail.setUser(new UserInfo(uid)); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + + // artificial + + /** + * 浜哄伐鍗囩骇浼氬憳娑堟伅 + * @Title: artificialVipPreUpgradeSuccess + * @Description: + * @param uid + * @param originalName + * @param upName + * @param days + * @return + * MsgAccountDetail 杩斿洖绫诲瀷 + * @throws + */ + public static MsgAccountDetail artificialVipUpgradeSuccess(Long uid, String originalName, String upName, int days) { + if (uid == null || originalName == null || upName == null) + return null; + + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + + List<ClientTextStyleVO> contentList2 = new ArrayList<>(); + contentList2.add(new ClientTextStyleVO("浣犵殑璐︽埛宸茬敱" + originalName + "鍗囩骇涓�", ClientTextStyleVO.COLOR_CONTENT)); + contentList2.add(new ClientTextStyleVO(upName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎴愰暱璇︽儏", ClientTextStyleVO.COLOR_TITLE), + contentList2)); + + List<ClientTextStyleVO> contentList3 = new ArrayList<>(); + contentList3.add(new ClientTextStyleVO(days + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList3.add(new ClientTextStyleVO("澶�", ClientTextStyleVO.COLOR_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍏辫�楁椂", ClientTextStyleVO.COLOR_TITLE), + contentList3)); + + 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("鏃�", ClientTextStyleVO.COLOR_CONTENT))); + + MsgAccountDetail detail = new MsgAccountDetail(); + detail.setTitle("绛夌骇鎴愰暱"); + detail.setType(MsgTypeAccountTypeEnum.vipPgrade); + detail.setUser(new UserInfo(uid)); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + + /** + * 浜哄伐鍗囩骇浼氬憳娑堟伅澶辫触 + * @Title: artificialVipUpgradeFail + * @Description: + * @param uid + * @param originalName + * @param upName + * @param reson + * @return + * MsgAccountDetail 杩斿洖绫诲瀷 + * @throws + */ + public static MsgAccountDetail artificialVipUpgradeFail(Long uid, String originalName, String upName, + String reson) { + if (uid == null || originalName == null || upName == null) + return null; + + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + + List<ClientTextStyleVO> contentList = new ArrayList<>(); + contentList.add(new ClientTextStyleVO("寰堟姳姝夛紒鏈�氳繃浜哄伐瀹℃牳 ", ClientTextStyleVO.COLOR_CONTENT)); + + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎴愰暱璇存槑", ClientTextStyleVO.COLOR_TITLE), + contentList)); + + List<ClientTextStyleVO> contentList2 = new ArrayList<>(); + contentList2.add(new ClientTextStyleVO("浣犵殑璐︽埛浠嶆槸" + originalName, ClientTextStyleVO.COLOR_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎴愰暱璇︽儏", ClientTextStyleVO.COLOR_TITLE), + contentList2)); + + List<ClientTextStyleVO> contentList3 = new ArrayList<>(); + contentList3.add(new ClientTextStyleVO(reson, ClientTextStyleVO.COLOR_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎷掔粷鍘熷洜", ClientTextStyleVO.COLOR_TITLE), + contentList3)); + + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("濡傛湁鐤戦棶璇疯仈绯讳汉宸ュ鏈�", ClientTextStyleVO.COLOR_CONTENT))); + + MsgAccountDetail detail = new MsgAccountDetail(); + detail.setTitle("绛夌骇鎴愰暱"); + detail.setType(MsgTypeAccountTypeEnum.vipPgrade); + detail.setUser(new UserInfo(uid)); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + + /** + * 鏅�氫細鍛樸�侀珮绾т細鍛樿嚜鍔ㄦ彁鍗� + * @param uid + * @param originalName + * @param upName + * @param days + * @param targetNum1 + * @param type + * @param targetNum2 + * @param beizu + * @return + */ + public static MsgAccountDetail vipPreUpgrade(Long uid, String originalName, String upName, int days, + long targetNum1, Long targetNum2, boolean teamPass) { + if (uid == null || originalName == null || upName == null) + return null; + + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + List<ClientTextStyleVO> contentList = new ArrayList<>(); + contentList.add(new ClientTextStyleVO("鎭枩浣狅紒鏈夋晥", ClientTextStyleVO.COLOR_CONTENT)); + if (teamPass) { + contentList.add(new ClientTextStyleVO("鐩存帴绮変笣宸茶揪", ClientTextStyleVO.COLOR_CONTENT)); + contentList.add(new ClientTextStyleVO(targetNum1 + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList.add(new ClientTextStyleVO("浜猴紝鏈夋晥闂存帴绮変笣宸茶揪", ClientTextStyleVO.COLOR_CONTENT)); + contentList.add(new ClientTextStyleVO(targetNum2 + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList.add(new ClientTextStyleVO("浜�", ClientTextStyleVO.COLOR_CONTENT)); + } else { + contentList.add(new ClientTextStyleVO("杩斿埄+鍒嗕韩璁㈠崟宸茶揪", ClientTextStyleVO.COLOR_CONTENT)); + contentList.add(new ClientTextStyleVO(targetNum1 + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList.add(new ClientTextStyleVO("绗�", ClientTextStyleVO.COLOR_CONTENT)); + } + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎴愰暱璇存槑", ClientTextStyleVO.COLOR_TITLE), + contentList)); + + List<ClientTextStyleVO> contentList2 = new ArrayList<>(); + contentList2.add(new ClientTextStyleVO("浣犵殑璐︽埛宸茬敱" + originalName + "鍗囩骇涓�", ClientTextStyleVO.COLOR_CONTENT)); + contentList2.add(new ClientTextStyleVO(upName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎴愰暱璇︽儏", ClientTextStyleVO.COLOR_TITLE), + contentList2)); + + List<ClientTextStyleVO> contentList3 = new ArrayList<>(); + contentList3.add(new ClientTextStyleVO(days + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList3.add(new ClientTextStyleVO("澶�", ClientTextStyleVO.COLOR_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍏辫�楁椂", ClientTextStyleVO.COLOR_TITLE), + contentList3)); + + 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("鏃�", ClientTextStyleVO.COLOR_CONTENT))); + + MsgAccountDetail detail = new MsgAccountDetail(); + detail.setTitle("绛夌骇鎴愰暱"); + detail.setType(MsgTypeAccountTypeEnum.vipPgrade); + detail.setUser(new UserInfo(uid)); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + + /** + * 鏅�氫細鍛樸�侀珮绾т細鍛樿嚜鍔ㄦ彁鍗� + * @param uid + * @param originalName + * @param upName + * @param days + * @param targetNum1 + * @param type + * @param targetNum2 + * @param beizu + * @return + */ + public static MsgAccountDetail vipUpgradeSuccess(Long uid, int days) { + if (uid == null) + return null; + + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + 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("瓒呯骇浼氬憳", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎴愰暱璇︽儏", ClientTextStyleVO.COLOR_TITLE), + contentList2)); + + List<ClientTextStyleVO> contentList3 = new ArrayList<>(); + contentList3.add(new ClientTextStyleVO(days + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList3.add(new ClientTextStyleVO("澶�", ClientTextStyleVO.COLOR_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍏辫�楁椂", ClientTextStyleVO.COLOR_TITLE), + contentList3)); + + 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("鎰熸仼鍔姏鐨勮嚜宸憋紝璁╂垜浠惡鎵嬫澘鏍楀揩鐪佷竴璧锋垚闀�", ClientTextStyleVO.COLOR_CONTENT))); + + MsgAccountDetail detail = new MsgAccountDetail(); + detail.setTitle("绛夌骇鎴愰暱"); + detail.setType(MsgTypeAccountTypeEnum.vipPgrade); + detail.setUser(new UserInfo(uid)); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + + /** + * 鏅�氫細鍛樸�侀珮绾т細鍛樿嚜鍔ㄦ彁鍗� + * @param uid + * @param originalName + * @param upName + * @param days + * @param targetNum1 + * @param type + * @param targetNum2 + * @param beizu + * @return + */ + public static MsgAccountDetail vipUpgradeFail(Long uid, String reason) { + if (uid == null) + return null; + + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + 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("浣犵殑璐︽埛浠嶆槸楂樼骇浼氬憳", ClientTextStyleVO.COLOR_CONTENT))); + + if (!StringUtil.isNullOrEmpty(reason)) { + listMsg.add( + CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎷掔粷鍘熷洜", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(reason, ClientTextStyleVO.COLOR_CONTENT))); + } + + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("濡傛湁鐤戦棶璇疯仈绯讳汉宸ュ鏈�", ClientTextStyleVO.COLOR_CONTENT))); + + MsgAccountDetail detail = new MsgAccountDetail(); + detail.setTitle("绛夌骇鎴愰暱"); + detail.setType(MsgTypeAccountTypeEnum.vipPgrade); + detail.setUser(new UserInfo(uid)); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + + /** + * 璧勬繁瀵煎笀--杩愯惀鍙戝嚭閭�绾� + * @param uid + * @param nickname + * @param kefuName + * @param kefuWX + * @return + */ + public static MsgAccountDetail teacherInvite(Long uid, String nickname, String kefuName, String kefuWX) { + if (uid == null) + return null; + + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("閭�绾﹀師鍥�", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("灏婃暚鐨�" + nickname + "锛屼綘宸茬鍚堟垚闀夸负涓�鍚嶈祫娣卞甯堢殑鏉′欢锛屽笇鏈涗綘鑳藉姞鍏ユ澘鏍楀揩鐪佽繍钀ュ洟闃燂紝涓庢垜浠叡鍒涜緣鐓�", + ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("涓撳睘瀹㈡湇", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(kefuName + "-寰俊鍙�:" + kefuWX, ClientTextStyleVO.COLOR_CONTENT))); + 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("璧勬繁瀵煎笀璧勬牸闇�瑕佸悗鍙版墜鍔ㄥ紑閫氾紝璇峰姟蹇呰仈绯讳笓灞炲鏈�", ClientTextStyleVO.COLOR_CONTENT))); + + MsgAccountDetail detail = new MsgAccountDetail(); + detail.setTitle("绛夌骇鎴愰暱"); + detail.setType(MsgTypeAccountTypeEnum.vipPgrade); + detail.setUser(new UserInfo(uid)); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + + /** + * 璧勬繁瀵煎笀--杩愯惀鍙戝嚭閭�绾� + * @param uid + * @param nickname + * @param kefuName + * @param kefuWX + * @return + */ + public static MsgAccountDetail teacherSuccess(Long uid, int days, String kefuName, String kefuWX) { + if (uid == 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_HIGHLIGHT_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎴愰暱璇︽儏", ClientTextStyleVO.COLOR_TITLE), + contentList)); + + List<ClientTextStyleVO> contentList2 = new ArrayList<>(); + contentList2.add(new ClientTextStyleVO(days + "", 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("浠庢敹鍒版湰娑堟伅璧凤紝浣犲皢鑾峰緱璇ヨ处鎴风瓑绾у搴旂殑鍏ㄩ儴鏉冪泭", ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("涓撳睘瀹㈡湇", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(kefuName + "-寰俊鍙�:" + kefuWX, ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("涓庝綘鍏卞垱杈夌厡", ClientTextStyleVO.COLOR_CONTENT))); + + MsgAccountDetail detail = new MsgAccountDetail(); + detail.setTitle("绛夌骇鎴愰暱"); + detail.setType(MsgTypeAccountTypeEnum.vipPgrade); + detail.setUser(new UserInfo(uid)); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } +} -- Gitblit v1.8.0