ソースを参照

Merge branch 'master' of https://app.yhyue.com/moapp/jypkg

wangchuanjin 2 年 前
コミット
4cf703ace1

+ 2 - 2
common/src/qfw/util/jy/bigVipPower.go

@@ -154,13 +154,13 @@ func GetBigVipUserBaseMsg(session *httpsession.Session, middleground middlegroun
 	accountId := qutil.Int64All(session.Get("accountId"))
 	positionId := qutil.Int64All(session.Get("positionId"))
 	userPower := BigVipBaseMsg{}
-	log.Println("userId:", userId, "-baseUserId:", baseUserId, "-accountId:", accountId, "-entId:", entId, "-positionType:", positionType, "-baseUserId:", baseUserId, "-accountId:", accountId, "-entId:", entId, "-positionType:", positionType, "-positionId:", positionId)
-	data := middleground.PowerCheckCenter.Check("10000", userId, baseUserId, accountId, entId, positionType, positionId)
 	if positionType == 0 {
 		userId = qutil.InterfaceToStr(session.Get("userId"))
 	} else {
 		userId = qutil.InterfaceToStr(session.Get("mgoUserId"))
 	}
+	log.Println("userId:", userId, "-baseUserId:", baseUserId, "-accountId:", accountId, "-entId:", entId, "-positionType:", positionType, "-baseUserId:", baseUserId, "-accountId:", accountId, "-entId:", entId, "-positionType:", positionType, "-positionId:", positionId)
+	data := middleground.PowerCheckCenter.Check("10000", userId, baseUserId, accountId, entId, positionType, positionId)
 	if data != nil {
 		power := make(map[int]bool)
 		for k, _ := range data.Member.MemberPowerList {

+ 25 - 0
common/src/qfw/util/jy/userCenter.go

@@ -0,0 +1,25 @@
+package jy
+
+import (
+	"app.yhyue.com/moapp/jybase/mongodb"
+	"app.yhyue.com/moapp/jypkg/middleground"
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
+)
+
+//获取base-user相关参数
+func AddUser(mgo mongodb.MongodbSim, userid string, req pb.UserAddReq, middleground middleground.Middleground) bool {
+	if resp := middleground.UserCenter.UserAdd(req); resp != nil {
+		//获取到baseid
+		baseId := resp.Data.Id
+		if baseId > 0 {
+			//user表记录映射关系
+			ok := mgo.UpdateById("user", userid, map[string]interface{}{
+				"$set": map[string]interface{}{
+					"base_user_id": baseId,
+				},
+			})
+			return resp.Data.Status == 1 && ok
+		}
+	}
+	return false
+}