From 02b81b52fbba024632f354d93f48586043a818ed Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 19 一月 2019 09:52:58 +0800
Subject: [PATCH] 测试

---
 fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgAccountDetailFactory.java |   96 +++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 90 insertions(+), 6 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 1653b88..9f0ae6b 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,8 +1,16 @@
 package com.yeshi.fanli.util.factory.msg;
 
+import java.util.Date;
+
 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;
 
 public class MsgAccountDetailFactory {
+	public final static int TYPE_WX = 1;// 寰俊
+	public final static int TYPE_TB = 2;// 娣樺疂
+	public final static int TYPE_PHONE = 3;// 鐢佃瘽
 
 	/**
 	 * 璐﹀彿缁戝畾鎴愬姛
@@ -12,8 +20,25 @@
 	 * @return
 	 */
 	public static MsgAccountDetail createBindingAccount(Long uid, int type) {
-
-		return null;
+		String msg = "";
+		if (type == TYPE_PHONE) {
+			msg = "<highlight>鎭枩浣犳墜鏈哄彿缁戝畾鎴愬姛</highlight>";
+		} else if (type == TYPE_TB) {
+			msg = "<highlight>鎭枩浣犳窐瀹濈粦瀹氭垚鍔�</highlight>";
+		} else if (type == TYPE_WX) {
+			msg = "<highlight>鎭枩浣犲井淇$粦瀹氭垚鍔�</highlight>";
+		}
+		if (StringUtil.isNullOrEmpty(msg))
+			return null;
+		MsgAccountDetail detail = new MsgAccountDetail();
+		detail.setBeiZhu("鏃�");
+		detail.setContent(msg);
+		detail.setTitle("缁戝畾璐﹀彿");
+		detail.setType(MsgTypeAccountTypeEnum.bingding);
+		detail.setUser(new UserInfo(uid));
+		detail.setCreateTime(new Date());
+		detail.setRead(false);
+		return detail;
 	}
 
 	/**
@@ -24,8 +49,25 @@
 	 * @return
 	 */
 	public static MsgAccountDetail createUnBindingAccount(Long uid, int type) {
-
-		return null;
+		String msg = "";
+		if (type == TYPE_PHONE) {
+			msg = "<highlight>鎵嬫満鍙疯В缁戞垚鍔�</highlight>";
+		} else if (type == TYPE_TB) {
+			msg = "<highlight>娣樺疂瑙g粦鎴愬姛</highlight>";
+		} else if (type == TYPE_WX) {
+			msg = "<highlight>寰俊瑙g粦鎴愬姛</highlight>";
+		}
+		if (StringUtil.isNullOrEmpty(msg))
+			return null;
+		MsgAccountDetail detail = new MsgAccountDetail();
+		detail.setBeiZhu("鏃�");
+		detail.setContent(msg);
+		detail.setTitle("瑙g粦璐﹀彿");
+		detail.setType(MsgTypeAccountTypeEnum.cancelBinding);
+		detail.setUser(new UserInfo(uid));
+		detail.setCreateTime(new Date());
+		detail.setRead(false);
+		return detail;
 	}
 
 	/**
@@ -36,8 +78,50 @@
 	 * @return
 	 */
 	public static MsgAccountDetail createChangeBindingAccount(Long uid, int type) {
-
-		return null;
+		String msg = "";
+		if (type == TYPE_PHONE) {
+			msg = "<highlight>鎵嬫満鍙锋洿鎹㈢粦瀹氭垚鍔�</highlight>";
+		} else if (type == TYPE_TB) {
+			msg = "<highlight>娣樺疂鏇存崲缁戝畾鎴愬姛</highlight>";
+		} else if (type == TYPE_WX) {
+			msg = "<highlight>寰俊鏇存崲缁戝畾鎴愬姛</highlight>";
+		}
+		if (StringUtil.isNullOrEmpty(msg))
+			return null;
+		MsgAccountDetail detail = new MsgAccountDetail();
+		detail.setBeiZhu("鏃�");
+		detail.setContent(msg);
+		detail.setTitle("鏇存崲缁戝畾璐﹀彿");
+		detail.setType(MsgTypeAccountTypeEnum.bingdingChange);
+		detail.setUser(new UserInfo(uid));
+		detail.setCreateTime(new Date());
+		detail.setRead(false);
+		return detail;
 	}
 
+	/**
+	 * 璐﹀彿鎵撻��
+	 * 
+	 * @param mainUid
+	 * @param lessUid
+	 * @return
+	 */
+	public static MsgAccountDetail createConnectAccount(Long mainUid, Long lessUid) {
+		if (mainUid == null || lessUid == null)
+			return null;
+		String msg = String.format("鎭枩浣犺处鍙峰悎骞舵垚鍔燂紝鐢扁��<highlight>%s</highlight>鈥濆悎骞跺埌鈥�<highlight>%s</highlight>鈥�", lessUid + "",
+				mainUid + "");
+		MsgAccountDetail detail = new MsgAccountDetail();
+		detail.setBeiZhu("鏃�");
+		detail.setContent(msg);
+		detail.setTitle("璐﹀彿鍚堝苟");
+		detail.setType(MsgTypeAccountTypeEnum.connect);
+		detail.setUser(new UserInfo(mainUid));
+		detail.setCreateTime(new Date());
+		detail.setRead(false);
+		return detail;
+	}
+
+	// TODO 璐﹀彿绛夌骇
+
 }

--
Gitblit v1.8.0