Merge remote-tracking branch 'origin/tuoyun' into tuoyun

This commit is contained in:
skiffer-git
2022-04-26 09:09:44 +08:00
52 changed files with 2877 additions and 741 deletions
+1 -1
View File
@@ -93,6 +93,6 @@ func UserToken(c *gin.Context) {
}
resp := api.UserTokenResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg},
UserToken: api.UserTokenInfo{UserID: req.FromUserID, Token: reply.Token, ExpiredTime: reply.ExpiredTime}}
log.NewInfo(req.OperationID, "UserRegister return ", resp)
log.NewInfo(req.OperationID, "UserToken return ", resp)
c.JSON(http.StatusOK, resp)
}
+32
View File
@@ -5,6 +5,7 @@ import (
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbConversation "Open_IM/pkg/proto/conversation"
pbUser "Open_IM/pkg/proto/user"
"Open_IM/pkg/utils"
"context"
@@ -44,6 +45,37 @@ func SetConversation(c *gin.Context) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
c.JSON(http.StatusOK, resp)
}
func ModifyConversationField(c *gin.Context) {
var (
req api.ModifyConversationFieldReq
resp api.ModifyConversationFieldResp
reqPb pbConversation.ModifyConversationFieldReq
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
reqPb.Conversation = &pbConversation.Conversation{}
err := utils.CopyStructFields(&reqPb, req)
err = utils.CopyStructFields(reqPb.Conversation, req.Conversation)
if err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", reqPb.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName)
client := pbConversation.NewConversationClient(etcdConn)
respPb, err := client.ModifyConversationField(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()})
return
}
resp.ErrMsg = respPb.CommonResp.ErrMsg
resp.ErrCode = respPb.CommonResp.ErrCode
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
c.JSON(http.StatusOK, resp)
}
func BatchSetConversations(c *gin.Context) {
var (
+84 -7
View File
@@ -201,7 +201,7 @@ func GetWorkMomentByID(c *gin.Context) {
if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
//resp.Data.WorkMoment = respPb.WorkMoment
resp.Data.WorkMoment = &apiStruct.WorkMoment{LikeUserList: []*apiStruct.WorkMomentUser{}, Comments: []*apiStruct.Comment{}, AtUserList: []*apiStruct.WorkMomentUser{}}
if err := utils.CopyStructFields(&resp.Data.WorkMoment, respPb.WorkMoment); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
@@ -222,7 +222,7 @@ func GetUserWorkMoments(c *gin.Context) {
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
ok, opUserID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
@@ -233,7 +233,8 @@ func GetUserWorkMoments(c *gin.Context) {
PageNumber: req.PageNumber,
ShowNumber: req.ShowNumber,
}
reqPb.UserID = userID
reqPb.OpUserID = opUserID
reqPb.UserID = req.UserID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName)
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.GetUserWorkMoments(context.Background(), &reqPb)
@@ -242,11 +243,49 @@ func GetUserWorkMoments(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserWorkMoments rpc server failed" + err.Error()})
return
}
resp.Data.WorkMoments = []*apiStruct.WorkMoment{}
if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
if err := utils.CopyStructFields(&resp.Data.WorkMoments, respPb.WorkMoments); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
//if err := utils.CopyStructFields(&resp.Data.WorkMoments, respPb.WorkMoments); err != nil {
// log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
//}
for _, v := range respPb.WorkMoments {
workMoment := apiStruct.WorkMoment{
WorkMomentID: v.WorkMomentID,
UserID: v.UserID,
Content: v.Content,
FaceURL: v.FaceURL,
UserName: v.UserName,
CreateTime: v.CreateTime,
Comments: make([]*apiStruct.Comment, len(v.Comments)),
LikeUserList: make([]*apiStruct.WorkMomentUser, len(v.LikeUserList)),
AtUserList: make([]*apiStruct.WorkMomentUser, len(v.AtUserList)),
}
for i, comment := range v.Comments {
workMoment.Comments[i] = &apiStruct.Comment{
UserID: comment.UserID,
UserName: comment.UserName,
ReplyUserID: comment.ReplyUserID,
ReplyUserName: comment.ReplyUserID,
ContentID: comment.ContentID,
Content: comment.Content,
CreateTime: comment.CreateTime,
}
}
for i, likeUser := range v.LikeUserList {
workMoment.LikeUserList[i] = &apiStruct.WorkMomentUser{
UserID: likeUser.UserID,
UserName: likeUser.UserName,
}
}
for i, atUser := range v.AtUserList {
workMoment.AtUserList[i] = &apiStruct.WorkMomentUser{
UserID: atUser.UserID,
UserName: atUser.UserName,
}
}
resp.Data.WorkMoments = append(resp.Data.WorkMoments, &workMoment)
}
resp.Data.ShowNumber = respPb.Pagination.ShowNumber
resp.Data.CurrentPage = respPb.Pagination.CurrentPage
@@ -290,8 +329,46 @@ func GetUserFriendWorkMoments(c *gin.Context) {
if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
if err := utils.CopyStructFields(&resp.Data.WorkMoments, respPb.WorkMoments); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
//if err := utils.CopyStructFields(&resp.Data.WorkMoments, respPb.WorkMoments); err != nil {
// log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
//}
resp.Data.WorkMoments = []*apiStruct.WorkMoment{}
for _, v := range respPb.WorkMoments {
workMoment := apiStruct.WorkMoment{
WorkMomentID: v.WorkMomentID,
UserID: v.UserID,
Content: v.Content,
FaceURL: v.FaceURL,
UserName: v.UserName,
CreateTime: v.CreateTime,
Comments: make([]*apiStruct.Comment, len(v.Comments)),
LikeUserList: make([]*apiStruct.WorkMomentUser, len(v.LikeUserList)),
AtUserList: make([]*apiStruct.WorkMomentUser, len(v.AtUserList)),
}
for i, comment := range v.Comments {
workMoment.Comments[i] = &apiStruct.Comment{
UserID: comment.UserID,
UserName: comment.UserName,
ReplyUserID: comment.ReplyUserID,
ReplyUserName: comment.ReplyUserID,
ContentID: comment.ContentID,
Content: comment.Content,
CreateTime: comment.CreateTime,
}
}
for i, likeUser := range v.LikeUserList {
workMoment.LikeUserList[i] = &apiStruct.WorkMomentUser{
UserID: likeUser.UserID,
UserName: likeUser.UserName,
}
}
for i, atUser := range v.AtUserList {
workMoment.AtUserList[i] = &apiStruct.WorkMomentUser{
UserID: atUser.UserID,
UserName: atUser.UserName,
}
}
resp.Data.WorkMoments = append(resp.Data.WorkMoments, &workMoment)
}
resp.Data.ShowNumber = respPb.Pagination.ShowNumber
resp.Data.CurrentPage = respPb.Pagination.CurrentPage
+6 -5
View File
@@ -7,6 +7,7 @@ import (
"context"
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
"github.com/minio/minio-go/v7/pkg/policy"
url2 "net/url"
)
@@ -58,10 +59,10 @@ func MinioInit() {
}
}
// 自动化桶public的代码
//err = minioClient.SetBucketPolicy(context.Background(), config.Config.Credential.Minio.Bucket, policy.BucketPolicyReadWrite)
//if err != nil {
// log.NewError("", utils.GetSelfFuncName(), "SetBucketPolicy failed please set in web", err.Error())
// return
//}
err = minioClient.SetBucketPolicy(context.Background(), config.Config.Credential.Minio.Bucket, policy.BucketPolicyReadWrite)
if err != nil {
log.NewDebug("", utils.GetSelfFuncName(), "SetBucketPolicy failed please set in web", err.Error())
return
}
log.NewInfo(operationID, utils.GetSelfFuncName(), "minio create and set policy success")
}
+125 -27
View File
@@ -8,6 +8,7 @@ import (
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"Open_IM/pkg/proto/cache"
pbRelay "Open_IM/pkg/proto/relay"
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
rpc "Open_IM/pkg/proto/user"
@@ -64,34 +65,100 @@ func GetUsersInfo(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"errCode": http.StatusBadRequest, "errMsg": err.Error()})
return
}
req := &rpc.GetUserInfoReq{}
utils.CopyStructFields(req, &params)
getUserInfoReq := &rpc.GetUserInfoReq{}
getUserInfoReq.OperationID = params.OperationID
var ok bool
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
ok, getUserInfoReq.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), getUserInfoReq.OperationID)
if !ok {
log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
log.NewError(getUserInfoReq.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
return
}
log.NewInfo(params.OperationID, "GetUserInfo args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName)
client := rpc.NewUserClient(etcdConn)
RpcResp, err := client.GetUserInfo(context.Background(), req)
log.NewInfo(params.OperationID, "GetUserInfo args ", getUserInfoReq.String())
reqCacheGetUserInfo := &cache.GetUserInfoReq{}
utils.CopyStructFields(reqCacheGetUserInfo, &params)
var userInfoList []*open_im_sdk.UserInfo
var publicUserInfoList []*open_im_sdk.PublicUserInfo
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName)
cacheClient := cache.NewCacheClient(etcdConn)
cacheResp, err := cacheClient.GetUserInfo(context.Background(), reqCacheGetUserInfo)
if err != nil {
log.NewError(req.OperationID, "GetUserInfo failed ", err.Error(), req.String())
log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()})
return
}
if cacheResp.CommonResp.ErrCode != 0 {
log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", cacheResp.CommonResp)
resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}}
resp.Data = []map[string]interface{}{}
log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp)
c.JSON(http.StatusOK, resp)
return
}
log.NewInfo(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "cacheResp:", cacheResp.String())
userInfoList = cacheResp.UserInfoList
var needCacheUserIDList []string
for _, userID := range reqCacheGetUserInfo.UserIDList {
isGetUserInfoFromCache := false
for _, cacheUser := range userInfoList {
if cacheUser.UserID == userID {
isGetUserInfoFromCache = true
}
}
if !isGetUserInfoFromCache {
needCacheUserIDList = append(needCacheUserIDList, userID)
}
}
if len(needCacheUserIDList) == 0 {
log.NewInfo(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "get all userInfo from cache success")
for _, v := range userInfoList {
publicUserInfoList = append(publicUserInfoList,
&open_im_sdk.PublicUserInfo{UserID: v.UserID, Nickname: v.Nickname, FaceURL: v.FaceURL, Gender: v.Gender, Ex: v.Ex})
}
resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList}
resp.Data = jsonData.JsonDataList(resp.UserInfoList)
log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp)
c.JSON(http.StatusOK, resp)
return
}
log.NewDebug(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "need cache user list", needCacheUserIDList)
getUserInfoReq.UserIDList = needCacheUserIDList
etcdConn = getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName)
client := rpc.NewUserClient(etcdConn)
rpcResp, err := client.GetUserInfo(context.Background(), getUserInfoReq)
if err != nil {
log.NewError(getUserInfoReq.OperationID, "GetUserInfo failed ", err.Error(), getUserInfoReq.String())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed" + err.Error()})
return
}
if rpcResp.CommonResp.ErrCode != 0 {
log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", cacheResp.CommonResp)
resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}}
resp.Data = []map[string]interface{}{}
log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp)
c.JSON(http.StatusOK, resp)
return
}
userInfoList = append(userInfoList, rpcResp.UserInfoList...)
cacheUpdateUserInfoReq := &cache.UpdateUserInfoReq{
UserInfoList: rpcResp.UserInfoList,
OperationID: getUserInfoReq.OperationID,
}
_, err = cacheClient.UpdateUserInfo(context.Background(), cacheUpdateUserInfoReq)
if err != nil {
log.NewError(getUserInfoReq.OperationID, "GetUserInfo failed ", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"})
return
}
var publicUserInfoList []*open_im_sdk.PublicUserInfo
for _, v := range RpcResp.UserInfoList {
userInfoList = rpcResp.UserInfoList
for _, v := range userInfoList {
publicUserInfoList = append(publicUserInfoList,
&open_im_sdk.PublicUserInfo{UserID: v.UserID, Nickname: v.Nickname, FaceURL: v.FaceURL, Gender: v.Gender, Ex: v.Ex})
}
resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList}
resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList}
resp.Data = jsonData.JsonDataList(resp.UserInfoList)
log.NewInfo(req.OperationID, "GetUserInfo api return ", resp)
log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp)
c.JSON(http.StatusOK, resp)
}
@@ -114,18 +181,34 @@ func UpdateUserInfo(c *gin.Context) {
return
}
log.NewInfo(params.OperationID, "UpdateUserInfo args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName)
client := rpc.NewUserClient(etcdConn)
RpcResp, err := client.UpdateUserInfo(context.Background(), req)
etcdConnUser := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName)
client := rpc.NewUserClient(etcdConnUser)
rpcResp, err := client.UpdateUserInfo(context.Background(), req)
if err != nil {
log.NewError(req.OperationID, "UpdateUserInfo failed ", err.Error(), req.String())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"})
return
}
resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}}
log.NewInfo(req.OperationID, "UpdateUserInfo api return ", resp)
c.JSON(http.StatusOK, resp)
if rpcResp.CommonResp.ErrCode != 0 {
log.NewError(req.OperationID, utils.GetSelfFuncName(), rpcResp.CommonResp.String())
resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}}
c.JSON(http.StatusOK, resp)
return
} else {
updateUserInfoReq := &cache.UpdateUserInfoReq{UserInfoList: []*open_im_sdk.UserInfo{req.UserInfo}}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), updateUserInfoReq.String())
etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName)
cacheClient := cache.NewCacheClient(etcdConnCache)
cacheResp, err := cacheClient.UpdateUserInfo(context.Background(), updateUserInfoReq)
if err != nil {
log.NewError(req.OperationID, "UpdateUserInfo cache failed ", err.Error(), req.String())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()})
return
}
resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}}
log.NewInfo(req.OperationID, "UpdateUserInfo api return ", resp)
c.JSON(http.StatusOK, resp)
}
}
func GetSelfUserInfo(c *gin.Context) {
@@ -157,16 +240,31 @@ func GetSelfUserInfo(c *gin.Context) {
return
}
if len(RpcResp.UserInfoList) == 1 {
resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfo: RpcResp.UserInfoList[0]}
resp.Data = jsonData.JsonDataOne(resp.UserInfo)
log.NewInfo(req.OperationID, "GetUserInfo api return ", resp)
c.JSON(http.StatusOK, resp)
updateUserInfoReq := &cache.UpdateUserInfoReq{UserInfoList: []*open_im_sdk.UserInfo{RpcResp.UserInfoList[0]}}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), updateUserInfoReq.String())
etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName)
cacheClient := cache.NewCacheClient(etcdConnCache)
cacheClient.UpdateUserInfo(context.Background(), updateUserInfoReq)
//if err != nil {
// log.NewError(req.OperationID, "UpdateUserInfo cache failed ", err.Error(), req.String())
// c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()})
// return
//}
//if cacheResp.CommonResp.ErrCode != 0 {
// log.NewError(req.OperationID, utils.GetSelfFuncName(), cacheResp.CommonResp.String())
// resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}}
// c.JSON(http.StatusOK, resp)
// return
//}
//resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfo: RpcResp.UserInfoList[0]}
//resp.Data = jsonData.JsonDataOne(resp.UserInfo)
//log.NewInfo(req.OperationID, "GetUserInfo api return ", resp)
//c.JSON(http.StatusOK, resp)
} else {
resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}}
log.NewInfo(req.OperationID, "GetUserInfo api return ", resp)
c.JSON(http.StatusOK, resp)
}
}
func GetUsersOnlineStatus(c *gin.Context) {