pull/455/head
skiffer-git 2 years ago committed by Xinwei Xiong(cubxxw-openim)
parent e4eea8cb35
commit 431472363d

@ -372,24 +372,24 @@ func GetGroupsInfo(c *gin.Context) {
return 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) resp.Data = jsonData.JsonDataList(resp.GroupInfoList)
log.NewInfo(req.OperationID, "GetGroupsInfo api return ", resp) log.NewInfo(req.OperationID, "GetGroupsInfo api return ", resp)
c.JSON(http.StatusOK, resp) c.JSON(http.StatusOK, resp)
} }
func transferGroupInfo(input []*open_im_sdk.GroupInfo) []*api.GroupInfoAlias { //func transferGroupInfo(input []*open_im_sdk.GroupInfo) []*api.GroupInfoAlias {
var result []*api.GroupInfoAlias // var result []*api.GroupInfoAlias
for _, v := range input { // for _, v := range input {
t := &api.GroupInfoAlias{} // t := &api.GroupInfoAlias{}
utils.CopyStructFields(t, &v) // utils.CopyStructFields(t, &v)
if v.NeedVerification != nil { // if v.NeedVerification != nil {
t.NeedVerification = v.NeedVerification.Value // t.NeedVerification = v.NeedVerification.Value
} // }
result = append(result, t) // result = append(result, t)
} // }
return result // return result
} //}
//process application //process application
func ApplicationGroupResponse(c *gin.Context) { func ApplicationGroupResponse(c *gin.Context) {

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

Loading…
Cancel
Save