mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Merge remote-tracking branch 'origin/tuoyun' into tuoyun
This commit is contained in:
commit
32fe763c0c
@ -53,8 +53,8 @@ func main() {
|
||||
groupRouterGroup.POST("/quit_group", group.QuitGroup) //1
|
||||
groupRouterGroup.POST("/group_application_response", group.ApplicationGroupResponse)
|
||||
groupRouterGroup.POST("/transfer_group", group.TransferGroupOwner)
|
||||
groupRouterGroup.POST("/get_group_applicationList", group.GetGroupApplicationList)
|
||||
groupRouterGroup.POST("/get_groups_info", group.GetGroupsInfo)
|
||||
groupRouterGroup.POST("/get_group_applicationList", group.GetGroupApplicationList) //1
|
||||
groupRouterGroup.POST("/get_groups_info", group.GetGroupsInfo) //1
|
||||
groupRouterGroup.POST("/kick_group", group.KickGroupMember)
|
||||
groupRouterGroup.POST("/get_group_member_list", group.GetGroupMemberList)
|
||||
groupRouterGroup.POST("/get_group_all_member_list", group.GetGroupAllMember)
|
||||
|
@ -338,7 +338,7 @@ func ApplicationGroupResponse(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
req := &rpc.GroupApplicationResponseReq{}
|
||||
utils.CopyStructFields(req, params)
|
||||
utils.CopyStructFields(req, ¶ms)
|
||||
var ok bool
|
||||
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"))
|
||||
if !ok {
|
||||
@ -357,9 +357,9 @@ func ApplicationGroupResponse(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
resp := api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}
|
||||
c.JSON(http.StatusOK, resp)
|
||||
resp := api.ApplicationGroupResponseResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}}
|
||||
log.NewInfo(req.OperationID, "ApplicationGroupResponse api return ", resp)
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
|
||||
func JoinGroup(c *gin.Context) {
|
||||
|
@ -432,23 +432,20 @@ func (s *groupServer) GroupApplicationResponse(_ context.Context, req *pbGroup.G
|
||||
log.NewInfo(req.OperationID, "GroupApplicationResponse args ", req.String())
|
||||
|
||||
groupRequest := imdb.GroupRequest{}
|
||||
utils.CopyStructFields(&groupRequest, req)
|
||||
groupRequest.UserID = req.FromUserID
|
||||
groupRequest.GroupID = req.GroupID
|
||||
groupRequest.HandledTime = time.Now()
|
||||
groupRequest.HandleResult = req.HandleResult
|
||||
groupRequest.HandleUserID = req.OpUserID
|
||||
groupRequest.HandledMsg = req.HandledMsg
|
||||
err := imdb.UpdateGroupRequest(groupRequest)
|
||||
if err != nil {
|
||||
log.NewError(req.OperationID, "GroupApplicationResponse failed ", err.Error(), req.String())
|
||||
return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
|
||||
}
|
||||
chat.ApplicationProcessedNotification(req)
|
||||
if req.HandleResult == 1 {
|
||||
if req.HandleResult == constant.GroupResponseAgree {
|
||||
chat.MemberEnterNotification(req)
|
||||
}
|
||||
|
||||
log.NewInfo(req.OperationID, "rpc GroupApplicationResponse return ")
|
||||
log.NewInfo(req.OperationID, "rpc GroupApplicationResponse return ", pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{}})
|
||||
return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{}}, nil
|
||||
}
|
||||
|
||||
|
@ -108,20 +108,20 @@ type GetGroupInfoResp struct {
|
||||
}
|
||||
|
||||
type ApplicationGroupResponseReq struct {
|
||||
OperationID string `json:"groupIDList" binding:"required"`
|
||||
GroupID string `json:"groupIDList" binding:"required"`
|
||||
FromUserID string `json:"groupIDList" binding:"required"`
|
||||
HandledMsg string `json:"groupIDList" binding:"required"`
|
||||
HandleResult int32 `json:"groupIDList" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"` //application from FromUserID
|
||||
HandledMsg string `json:"handledMsg"`
|
||||
HandleResult int32 `json:"handleResult" binding:"required, oneof=-1 1"`
|
||||
}
|
||||
type ApplicationGroupResponseResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type JoinGroupReq struct {
|
||||
GroupID string `json:"groupID"`
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
ReqMessage string `json:"reqMessage"`
|
||||
OperationID string `json:"operationID"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type JoinGroupResp struct {
|
||||
CommResp
|
||||
|
@ -125,6 +125,9 @@ const (
|
||||
GroupOwner = 2
|
||||
GroupAdmin = 3
|
||||
|
||||
GroupResponseAgree = 1
|
||||
GroupResponseRefuse = -1
|
||||
|
||||
Male = 1
|
||||
Female = 2
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user