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
479ce592fa
commit
ca92bc899b
@ -47,7 +47,7 @@ func main() {
|
||||
//group related routing group
|
||||
groupRouterGroup := r.Group("/group")
|
||||
{
|
||||
groupRouterGroup.POST("/create_group", group.CreateGroup)
|
||||
groupRouterGroup.POST("/create_group", group.CreateGroup) //1
|
||||
groupRouterGroup.POST("/set_group_info", group.SetGroupInfo)
|
||||
groupRouterGroup.POST("join_group", group.JoinGroup)
|
||||
groupRouterGroup.POST("/quit_group", group.QuitGroup)
|
||||
|
@ -443,7 +443,7 @@ func SetGroupInfo(c *gin.Context) {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"})
|
||||
return
|
||||
}
|
||||
resp := api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}
|
||||
resp := api.SetGroupInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}}
|
||||
c.JSON(http.StatusOK, resp)
|
||||
log.NewInfo(req.OperationID, "SetGroupInfo api return ", resp)
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package base_info
|
||||
|
||||
import (
|
||||
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
|
||||
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
||||
)
|
||||
|
||||
@ -135,7 +136,7 @@ type QuitGroupResp struct {
|
||||
}
|
||||
|
||||
type SetGroupInfoReq struct {
|
||||
open_im_sdk.GroupInfo
|
||||
imdb.Group
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type SetGroupInfoResp struct {
|
||||
|
@ -63,17 +63,19 @@ type FriendRequest struct {
|
||||
//}
|
||||
// open_im_sdk.GroupInfo (OwnerUserID , MemberCount )> imdb.Group
|
||||
type Group struct {
|
||||
GroupID string `gorm:"column:group_id;primaryKey;"`
|
||||
GroupName string `gorm:"column:name"`
|
||||
Notification string `gorm:"column:notification"`
|
||||
Introduction string `gorm:"column:introduction"`
|
||||
FaceUrl string `gorm:"column:face_url"`
|
||||
//`json:"operationID" binding:"required"`
|
||||
//`protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` `json:"operationID" binding:"required"`
|
||||
GroupID string `gorm:"column:group_id;primaryKey;" json:"groupID" binding:"required"`
|
||||
GroupName string `gorm:"column:name" json:"groupName"`
|
||||
Notification string `gorm:"column:notification" json:"notification"`
|
||||
Introduction string `gorm:"column:introduction" json:"introduction"`
|
||||
FaceUrl string `gorm:"column:face_url" json:"faceUrl"`
|
||||
|
||||
CreateTime time.Time `gorm:"column:create_time"`
|
||||
Status int32 `gorm:"column:status"`
|
||||
CreatorUserID string `gorm:"column:creator_user_id"`
|
||||
GroupType int32 `gorm:"column:group_type"`
|
||||
Ex string `gorm:"column:ex"`
|
||||
Ex string `gorm:"column:ex" json:"ex"`
|
||||
}
|
||||
|
||||
//message GroupMemberFullInfo {
|
||||
|
Loading…
x
Reference in New Issue
Block a user