|
@@ -16,6 +16,7 @@ var ContentType_Json = "application/json"
|
|
|
var UserCenterAdd = "/userCenter/user/add"
|
|
|
var UserCenterUpdate = "/userCenter/user/updateById"
|
|
|
var UserCenterDelete = "/userCenter/user/deleteById"
|
|
|
+var UserCenterGetUserIdentity = "/userCenter/user/identity"
|
|
|
|
|
|
/*
|
|
|
修改header 的post请求
|
|
@@ -219,3 +220,36 @@ func AddBaseUser(mgo mongodb.MongodbSim, href, userId string, formdata map[strin
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+type UserIdentity struct {
|
|
|
+ PersonId int64 //自然人id
|
|
|
+ UserAccountId int64 //个人账户id
|
|
|
+ EntAccountId int64 //企业账户id
|
|
|
+ EntUserAccountId int64 //企业雇员账户id
|
|
|
+ UserPositionId int64 // 个人职位id
|
|
|
+ EntUserPositionId int64 // 企业雇员职位id
|
|
|
+ UserName string //昵称
|
|
|
+}
|
|
|
+
|
|
|
+//获取用户中台服务 用户相关账户参数
|
|
|
+func GetUserIdentity(href, userId string, baseUserId, entId int64, ck *http.Cookie) *UserIdentity {
|
|
|
+ ret, ok := PostUserCenter(href+UserCenterGetUserIdentity, ContentType_Json, userId,
|
|
|
+ map[string]interface{}{
|
|
|
+ "appId": "10000",
|
|
|
+ "newUserId": baseUserId,
|
|
|
+ "entId": entId,
|
|
|
+ }, ck)
|
|
|
+ if ret != nil && ok {
|
|
|
+ return &UserIdentity{
|
|
|
+ PersonId: Int64All((*ret)["personId"]),
|
|
|
+ EntAccountId: Int64All((*ret)["entAccountId"]),
|
|
|
+ UserAccountId: Int64All((*ret)["userAccountId"]),
|
|
|
+ EntUserAccountId: Int64All((*ret)["entUserAccountId"]),
|
|
|
+ UserPositionId: Int64All((*ret)["userPositionId"]),
|
|
|
+ EntUserPositionId: Int64All((*ret)["entUserPositionId"]),
|
|
|
+ UserName: ObjToString((*ret)["userName"]),
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return nil
|
|
|
+}
|