From f4a0f2acc63d7785eab108419a4e16f5f688cb95 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期六, 18 一月 2020 12:06:27 +0800
Subject: [PATCH] 用户注册信息

---
 fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgInviteDetailFactory.java |  136 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 136 insertions(+), 0 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 e702166..df74e90 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,5 +1,141 @@
 package com.yeshi.fanli.util.factory.msg;
 
+import java.util.Date;
+
+import com.google.gson.Gson;
+import com.yeshi.fanli.dto.msg.MsgInviteContentDTO;
+import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail;
+import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail.MsgTypeInviteTypeEnum;
+import com.yeshi.fanli.entity.bus.user.ThreeSale;
+import com.yeshi.fanli.entity.bus.user.UserInfo;
+import com.yeshi.fanli.util.StringUtil;
+
 public class MsgInviteDetailFactory {
 
+	/**
+	 * 閭�璇锋垚鍔�
+	 * 
+	 * @param threeSale
+	 * @param uid
+	 * @return
+	 */
+	public static MsgInviteDetail createInviteSuccess(ThreeSale threeSale, Long uid, String beiZhu) {
+		if (threeSale == null || uid == null)
+			return null;
+
+		MsgInviteDetail detail = new MsgInviteDetail();
+		if (StringUtil.isNullOrEmpty(beiZhu))
+			detail.setBeiZhu("鏃�");
+		else
+			detail.setBeiZhu(beiZhu);
+		detail.setCreateTime(new Date());
+		detail.setDesc("鎭枩浣狅紝鎴愬姛閭�璇蜂竴涓矇涓�");
+		detail.setInviteUser(threeSale);
+		detail.setMsgType(MsgTypeInviteTypeEnum.invite);
+		detail.setRead(false);
+		detail.setUser(new UserInfo(uid));
+
+		return detail;
+	}
+	/**
+	 *   閭�璇锋垚鍔�
+	 * 
+	 * @param threeSale
+	 * @param uid
+	 * @return
+	 */
+	public static MsgInviteDetail createInviteSuccess2_1(Long uid, ThreeSale threeSale) {
+		if (threeSale == null || uid == null)
+			return null;
+		MsgInviteDetail detail = new MsgInviteDetail();
+		detail.setRead(false);
+		detail.setUser(new UserInfo(uid));
+		detail.setInviteUser(threeSale);
+		detail.setMsgType(MsgTypeInviteTypeEnum.inviteSucceed);
+		detail.setDesc("绮変笣锛堝ソ鍙嬶級鐔熺粌浣跨敤App鍙幏寰楃孩鍖�");
+		detail.setBeiZhu("婊¤冻鑾峰緱绾㈠寘鏉′欢鍚庣郴缁熷皢鑷姩涓嬪彂鍒扳�滄垜鐨�-绾㈠寘鈥濅腑");
+		detail.setCreateTime(new Date());
+		detail.setUpdateTime(new Date());
+		return detail;
+	}
+	
+	/**
+	 * 鎵弿閭�璇蜂簩缁寸爜鎴愬姛锛屼絾鏄湭鐧诲綍
+	 * 
+	 * @param threeSale
+	 * @param uid
+	 * @return
+	 */
+	public static MsgInviteDetail createInviteScanSuccess(ThreeSale threeSale, Long uid, String beiZhu) {
+		if (threeSale == null || uid == null)
+			return null;
+
+		MsgInviteDetail detail = new MsgInviteDetail();
+		if (StringUtil.isNullOrEmpty(beiZhu))
+			detail.setBeiZhu("鏃�");
+		else
+			detail.setBeiZhu(beiZhu);
+		detail.setCreateTime(new Date());
+		detail.setDesc("鎭枩浣狅紝鏈夋柊绮変笣鍔犲叆浣犵殑闃熷垪锛岃嫢瀵规柟60澶╁唴鏈縺娲诲皢浼氫笌浣犺劚绂婚個璇峰叧绯�");
+		detail.setInviteUser(threeSale);
+		detail.setMsgType(MsgTypeInviteTypeEnum.invite);
+		detail.setRead(false);
+		detail.setUser(new UserInfo(uid));
+		return detail;
+	}
+	
+	
+	
+
+	/**
+	 * 閭�璇峰け璐�
+	 * 
+	 * @param threeSale
+	 * @param uid
+	 * @return
+	 */
+	public static MsgInviteDetail createInviteFail(ThreeSale threeSale, Long uid, String beiZhu) {
+		if (threeSale == null || uid == null)
+			return null;
+
+		MsgInviteDetail detail = new MsgInviteDetail();
+		if (StringUtil.isNullOrEmpty(beiZhu))
+			detail.setBeiZhu("鏃�");
+		else
+			detail.setBeiZhu(beiZhu);
+		detail.setCreateTime(new Date());
+		detail.setDesc("鎶辨瓑锛岃绮変笣鍥�60澶╁唴鏈縺娲伙紝宸茶劚绂讳簡浣犵殑闃熷垪锛屽彲浠ヨ瘯鐫�閲嶆柊閭�璇�");
+		detail.setInviteUser(threeSale);
+		detail.setMsgType(MsgTypeInviteTypeEnum.invite);
+		detail.setRead(false);
+		detail.setUser(new UserInfo(uid));
+		return detail;
+	}
+	
+	
+	/**
+	 *  棰嗗彇淇℃伅婵�娲婚個璇峰叧绯�
+	 * 
+	 * @param threeSale
+	 * @param uid
+	 * @return
+	 */
+	public static MsgInviteDetail receiveGift(Long uid, String beiZhu, MsgInviteContentDTO content) {
+		if (content == null || uid == null)
+			return null;
+
+		MsgInviteDetail detail = new MsgInviteDetail();
+		if (StringUtil.isNullOrEmpty(beiZhu))
+			detail.setBeiZhu("鏃�");
+		else
+			detail.setBeiZhu(beiZhu);
+		
+		detail.setCreateTime(new Date());
+		detail.setUpdateTime(new Date());
+		detail.setDesc(new Gson().toJson(content));
+		detail.setMsgType(MsgTypeInviteTypeEnum.receiveGift);
+		detail.setRead(false);
+		detail.setUser(new UserInfo(uid));
+		return detail;
+	}
 }

--
Gitblit v1.8.0