first commit
This commit is contained in:
25
gateway/api/v1/internal/logic/group/join_group.go
Normal file
25
gateway/api/v1/internal/logic/group/join_group.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"gitlab.33.cn/chat/dtalk/gateway/api/v1/internal/types"
|
||||
pb "gitlab.33.cn/chat/dtalk/service/group/api"
|
||||
"gitlab.33.cn/utils/go-kit/convert"
|
||||
)
|
||||
|
||||
func (l *GroupLogic) JoinGroup(req *types.JoinGroupReq) (*types.JoinGroupResp, error) {
|
||||
groupId := req.Id
|
||||
|
||||
_, err := l.svcCtx.GroupClient.InviteGroupMembers(l.ctx, &pb.InviteGroupMembersReq{
|
||||
GroupId: groupId,
|
||||
InviterId: req.InviterId,
|
||||
MemberIds: []string{l.getOpe()},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &types.JoinGroupResp{
|
||||
Id: groupId,
|
||||
IdStr: convert.ToString(groupId),
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user