Refactor code

pull/131/head
wenxu12345 3 years ago
parent 6e14375b86
commit 9f55418bfb

@ -253,7 +253,7 @@ func CreateGroup(c *gin.Context) {
if RpcResp.ErrCode == 0 {
utils.CopyStructFields(&resp.GroupInfo, RpcResp.GroupInfo)
}
log.NewInfo(req.OperationID, "InviteUserToGroup api return ", resp)
log.NewInfo(req.OperationID, "CreateGroup api return ", resp)
c.JSON(http.StatusOK, resp)
}

@ -111,7 +111,7 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR
for _, user := range req.InitMemberList {
us, err := im_mysql_model.GetUserByUserID(user.UserID)
if err != nil {
log.NewError(req.OperationID, "FindUserByUID failed ", err.Error(), user.UserID)
log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), user.UserID)
continue
}
if user.RoleLevel == constant.GroupOwner {
@ -133,7 +133,7 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR
}
}
resp := &pbGroup.CreateGroupResp{}
resp := &pbGroup.CreateGroupResp{GroupInfo: &open_im_sdk.GroupInfo{}}
group, err := im_mysql_model.GetGroupInfoByGroupID(groupId)
if err != nil {
log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), groupId)
@ -143,7 +143,7 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR
}
chat.GroupCreatedNotification(req.OperationID, req.OpUserID, req.OwnerUserID, groupId, okUserIDList)
utils.CopyStructFields(resp.GroupInfo, group)
resp.GroupInfo.MemberCount = uint32(imdb.GetGroupMemberNumByGroupID(groupId))
resp.GroupInfo.MemberCount = imdb.GetGroupMemberNumByGroupID(groupId)
resp.GroupInfo.OwnerUserID = req.OwnerUserID
log.NewInfo(req.OperationID, "rpc CreateGroup return ", resp.String())

Loading…
Cancel
Save