Refactor code

pull/131/head
wenxu12345 3 years ago
parent e8ffcb0630
commit 9f5897e06c

@ -302,7 +302,7 @@ func GetGroupsInfo(c *gin.Context) {
return
}
req := &rpc.GetGroupsInfoReq{}
utils.CopyStructFields(req, params)
utils.CopyStructFields(req, &params)
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…
Cancel
Save