pull/236/head
skiffer-git 2 years ago
parent de32c46ea4
commit 3e630a3882

@ -464,12 +464,25 @@ func GetGroupsInfo(c *gin.Context) {
return
}
resp := api.GetGroupInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, GroupInfoList: RpcResp.GroupInfoList}
resp := api.GetGroupInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, GroupInfoList: transferGroupInfo(RpcResp.GroupInfoList)}
resp.Data = jsonData.JsonDataList(resp.GroupInfoList)
log.NewInfo(req.OperationID, "GetGroupsInfo api return ", resp)
c.JSON(http.StatusOK, resp)
}
func transferGroupInfo(input []*open_im_sdk.GroupInfo) []*api.GroupInfoAlias {
var result []*api.GroupInfoAlias
for _, v := range input {
t := &api.GroupInfoAlias{}
utils.CopyStructFields(t, &v)
if v.NeedVerification != nil {
t.NeedVerification = v.NeedVerification.Value
}
result = append(result, t)
}
return result
}
//process application
func ApplicationGroupResponse(c *gin.Context) {
params := api.ApplicationGroupResponseReq{}

@ -124,9 +124,24 @@ type GetGroupInfoReq struct {
}
type GetGroupInfoResp struct {
CommResp
GroupInfoList []*open_im_sdk.GroupInfo `json:"-"`
GroupInfoList []*GroupInfoAlias `json:"-"`
Data []map[string]interface{} `json:"data"`
}
type GroupInfoAlias struct {
GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"`
GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"`
Notification string `protobuf:"bytes,3,opt,name=notification" json:"notification,omitempty"`
Introduction string `protobuf:"bytes,4,opt,name=introduction" json:"introduction,omitempty"`
FaceURL string `protobuf:"bytes,5,opt,name=faceURL" json:"faceURL,omitempty"`
OwnerUserID string `protobuf:"bytes,6,opt,name=ownerUserID" json:"ownerUserID,omitempty"`
CreateTime uint32 `protobuf:"varint,7,opt,name=createTime" json:"createTime,omitempty"`
MemberCount uint32 `protobuf:"varint,8,opt,name=memberCount" json:"memberCount,omitempty"`
Ex string `protobuf:"bytes,9,opt,name=ex" json:"ex,omitempty"`
Status int32 `protobuf:"varint,10,opt,name=status" json:"status,omitempty"`
CreatorUserID string `protobuf:"bytes,11,opt,name=creatorUserID" json:"creatorUserID,omitempty"`
GroupType int32 `protobuf:"varint,12,opt,name=groupType" json:"groupType,omitempty"`
NeedVerification int32 `protobuf:"bytes,13,opt,name=needVerification" json:"needVerification,omitempty"`
}
type ApplicationGroupResponseReq struct {
OperationID string `json:"operationID" binding:"required"`

Loading…
Cancel
Save