|
|
@ -205,22 +205,22 @@ func GetSelfUserInfo(c *gin.Context) {
|
|
|
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), updateUserInfoReq.String())
|
|
|
|
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)
|
|
|
|
etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName)
|
|
|
|
cacheClient := cache.NewCacheClient(etcdConnCache)
|
|
|
|
cacheClient := cache.NewCacheClient(etcdConnCache)
|
|
|
|
cacheResp, err := cacheClient.UpdateUserInfo(context.Background(), updateUserInfoReq)
|
|
|
|
:= cacheClient.UpdateUserInfo(context.Background(), updateUserInfoReq)
|
|
|
|
if err != nil {
|
|
|
|
//if err != nil {
|
|
|
|
log.NewError(req.OperationID, "UpdateUserInfo cache failed ", err.Error(), req.String())
|
|
|
|
// 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()})
|
|
|
|
// c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()})
|
|
|
|
return
|
|
|
|
// return
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
if cacheResp.CommonResp.ErrCode != 0 {
|
|
|
|
//if cacheResp.CommonResp.ErrCode != 0 {
|
|
|
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), cacheResp.CommonResp.String())
|
|
|
|
// log.NewError(req.OperationID, utils.GetSelfFuncName(), cacheResp.CommonResp.String())
|
|
|
|
resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}}
|
|
|
|
// resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}}
|
|
|
|
c.JSON(http.StatusOK, resp)
|
|
|
|
// c.JSON(http.StatusOK, resp)
|
|
|
|
return
|
|
|
|
// return
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfo: RpcResp.UserInfoList[0]}
|
|
|
|
//resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfo: RpcResp.UserInfoList[0]}
|
|
|
|
resp.Data = jsonData.JsonDataOne(resp.UserInfo)
|
|
|
|
//resp.Data = jsonData.JsonDataOne(resp.UserInfo)
|
|
|
|
log.NewInfo(req.OperationID, "GetUserInfo api return ", resp)
|
|
|
|
//log.NewInfo(req.OperationID, "GetUserInfo api return ", resp)
|
|
|
|
c.JSON(http.StatusOK, resp)
|
|
|
|
//c.JSON(http.StatusOK, resp)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}}
|
|
|
|
resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}}
|
|
|
|
log.NewInfo(req.OperationID, "GetUserInfo api return ", resp)
|
|
|
|
log.NewInfo(req.OperationID, "GetUserInfo api return ", resp)
|
|
|
|