mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Refactor code
This commit is contained in:
parent
e8ffcb0630
commit
9f5897e06c
@ -302,7 +302,7 @@ func GetGroupsInfo(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
req := &rpc.GetGroupsInfoReq{}
|
req := &rpc.GetGroupsInfoReq{}
|
||||||
utils.CopyStructFields(req, params)
|
utils.CopyStructFields(req, ¶ms)
|
||||||
var ok bool
|
var ok bool
|
||||||
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"))
|
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"))
|
||||||
if !ok {
|
if !ok {
|
||||||
@ -321,9 +321,12 @@ func GetGroupsInfo(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
resp := api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}
|
resp := api.GetGroupInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, GroupInfoList: RpcResp.GroupInfoList}
|
||||||
c.JSON(http.StatusOK, resp)
|
if len(resp.GroupInfoList) == 0 {
|
||||||
|
resp.GroupInfoList = []*open_im_sdk.GroupInfo{}
|
||||||
|
}
|
||||||
log.NewInfo(req.OperationID, "GetGroupsInfo api return ", resp)
|
log.NewInfo(req.OperationID, "GetGroupsInfo api return ", resp)
|
||||||
|
c.JSON(http.StatusOK, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
//process application
|
//process application
|
||||||
|
@ -104,7 +104,7 @@ type GetGroupInfoReq struct {
|
|||||||
}
|
}
|
||||||
type GetGroupInfoResp struct {
|
type GetGroupInfoResp struct {
|
||||||
CommResp
|
CommResp
|
||||||
Data []open_im_sdk.GroupInfo `json:"data"`
|
GroupInfoList []*open_im_sdk.GroupInfo `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ApplicationGroupResponseReq struct {
|
type ApplicationGroupResponseReq struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user