From 431472363dfed82ac12a5fc9bc39626397d3b9e0 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 28 Jun 2022 18:26:32 +0800 Subject: [PATCH] fix bug --- internal/api/group/group.go | 26 ++++++++++----------- pkg/base_info/group_api_struct.go | 38 ++++++++++++++++++------------- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/internal/api/group/group.go b/internal/api/group/group.go index 76e87c983..7bdcb0e5d 100644 --- a/internal/api/group/group.go +++ b/internal/api/group/group.go @@ -372,24 +372,24 @@ func GetGroupsInfo(c *gin.Context) { return } - resp := api.GetGroupInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, GroupInfoList: transferGroupInfo(RpcResp.GroupInfoList)} + resp := api.GetGroupInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, GroupInfoList: 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 -} +//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) { diff --git a/pkg/base_info/group_api_struct.go b/pkg/base_info/group_api_struct.go index 65ce1d7e1..06beaa104 100644 --- a/pkg/base_info/group_api_struct.go +++ b/pkg/base_info/group_api_struct.go @@ -123,24 +123,30 @@ type GetGroupInfoReq struct { } type GetGroupInfoResp struct { CommResp - GroupInfoList []*GroupInfoAlias `json:"-"` + GroupInfoList []*open_im_sdk.GroupInfo `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 GroupInfoAlias struct { +// open_im_sdk.GroupInfo +// NeedVerification int32 `protobuf:"bytes,13,opt,name=needVerification" json:"needVerification,omitempty"` +//} + +//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"`