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
|
||||
}
|
||||
req := &rpc.GetGroupsInfoReq{}
|
||||
utils.CopyStructFields(req, params)
|
||||
utils.CopyStructFields(req, ¶ms)
|
||||
var ok bool
|
||||
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"))
|
||||
if !ok {
|
||||
@ -321,9 +321,12 @@ func GetGroupsInfo(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
resp := api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}
|
||||
c.JSON(http.StatusOK, resp)
|
||||
resp := api.GetGroupInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, GroupInfoList: RpcResp.GroupInfoList}
|
||||
if len(resp.GroupInfoList) == 0 {
|
||||
resp.GroupInfoList = []*open_im_sdk.GroupInfo{}
|
||||
}
|
||||
log.NewInfo(req.OperationID, "GetGroupsInfo api return ", resp)
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
|
||||
//process application
|
||||
|
@ -104,7 +104,7 @@ type GetGroupInfoReq struct {
|
||||
}
|
||||
type GetGroupInfoResp struct {
|
||||
CommResp
|
||||
Data []open_im_sdk.GroupInfo `json:"data"`
|
||||
GroupInfoList []*open_im_sdk.GroupInfo `json:"data"`
|
||||
}
|
||||
|
||||
type ApplicationGroupResponseReq struct {
|
||||
|
Loading…
x
Reference in New Issue
Block a user