first commit
This commit is contained in:
25
gateway/api/v1/internal/logic/group/set_admin.go
Normal file
25
gateway/api/v1/internal/logic/group/set_admin.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"gitlab.33.cn/chat/dtalk/gateway/api/v1/internal/types"
|
||||
xerror "gitlab.33.cn/chat/dtalk/pkg/error"
|
||||
pb "gitlab.33.cn/chat/dtalk/service/group/api"
|
||||
)
|
||||
|
||||
func (l *GroupLogic) SetAdmin(req *types.SetAdminReq) (*types.SetAdminResp, error) {
|
||||
if _, ok := pb.GroupMemberType_name[req.MemberType]; !ok {
|
||||
return nil, xerror.NewError(xerror.ParamsError)
|
||||
}
|
||||
|
||||
_, err := l.svcCtx.GroupClient.SetAdmin(l.ctx, &pb.SetAdminReq{
|
||||
GroupId: req.Id,
|
||||
PersonId: l.getOpe(),
|
||||
MemberId: req.MemberId,
|
||||
GroupMemberType: pb.GroupMemberType(req.MemberType),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &types.SetAdminResp{}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user