|
|
|
@ -66,11 +66,6 @@ type groupServer struct {
|
|
|
|
|
webhookClient *webhook.Client
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *groupServer) GetSpecifiedUserGroupRequestInfo(ctx context.Context, req *pbgroup.GetSpecifiedUserGroupRequestInfoReq) (*pbgroup.GetSpecifiedUserGroupRequestInfoResp, error) {
|
|
|
|
|
//TODO implement me
|
|
|
|
|
panic("implement me")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Config struct {
|
|
|
|
|
RpcConfig config.Group
|
|
|
|
|
RedisConfig config.Redis
|
|
|
|
@ -1756,14 +1751,21 @@ func (g *groupServer) GetGroupUsersReqApplicationList(ctx context.Context, req *
|
|
|
|
|
func (g *groupServer) GetSpecifiedUserGroupRequestInfo(ctx context.Context, req *pbgroup.GetSpecifiedUserGroupRequestInfoReq) (*pbgroup.GetSpecifiedUserGroupRequestInfoResp, error) {
|
|
|
|
|
opUserID := mcontext.GetOpUserID(ctx)
|
|
|
|
|
|
|
|
|
|
owners, err := g.db.FindGroupsOwner(ctx, []string{req.GroupID})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if req.UserID != opUserID {
|
|
|
|
|
req.UserID = mcontext.GetOpUserID(ctx)
|
|
|
|
|
memberIDs, err := g.db.GetGroupAdminLevelMemberIDs(ctx, req.GroupID)
|
|
|
|
|
adminIDs, err := g.db.GetGroupRoleLevelMemberIDs(ctx, req.GroupID, constant.GroupAdmin)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if !datautil.Contain(req.UserID, memberIDs...) {
|
|
|
|
|
adminIDs = append(adminIDs, owners[0].UserID)
|
|
|
|
|
|
|
|
|
|
if !datautil.Contain(req.UserID, adminIDs...) {
|
|
|
|
|
return nil, errs.ErrNoPermission.WrapMsg("opUser no permission")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1786,11 +1788,6 @@ func (g *groupServer) GetSpecifiedUserGroupRequestInfo(ctx context.Context, req
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
owners, err := g.db.FindGroupsOwner(ctx, []string{req.GroupID})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
groupMemberNum, err := g.db.MapGroupMemberNum(ctx, []string{req.GroupID})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|