From 258d85702678a19e0f0c5a2cb4be1a49a3e2b5cb Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Mon, 13 Oct 2025 18:09:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=9B=E5=BB=BA=E4=BB=A3?= =?UTF-8?q?=E7=90=86=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inner/asserts/team/TeamErrorCode.java | 6 ++++++ .../adapter/app/team/TeamRestController.java | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/team/TeamErrorCode.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/team/TeamErrorCode.java index 731a07b4..d1d0ab7a 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/team/TeamErrorCode.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/team/TeamErrorCode.java @@ -212,6 +212,12 @@ public enum TeamErrorCode implements IResponseErrorCode { * 拒绝接受. */ REFUSE_ACCEPT(6049, "Refuse accept"), + + /** + * 管理员权限不足 + */ + ADMIN_PERMISSION_INSUFFICIENT(6050, "Administrator permission insufficient"), + ; private final Integer code; diff --git a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/team/TeamRestController.java b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/team/TeamRestController.java index 6d078b66..b68ca329 100644 --- a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/team/TeamRestController.java +++ b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/team/TeamRestController.java @@ -6,6 +6,7 @@ import com.red.circle.common.business.dto.cmd.app.AppIdLongCmd; import com.red.circle.common.business.dto.cmd.app.AppIdStringCmd; import com.red.circle.common.business.dto.cmd.app.AppRoomIdCmd; import com.red.circle.common.business.dto.cmd.app.AppUserIdCmd; +import com.red.circle.framework.core.asserts.ResponseAssert; import com.red.circle.framework.web.controller.BaseController; import com.red.circle.other.app.dto.clientobject.team.*; import com.red.circle.other.app.dto.cmd.team.DateTypeQryCmd; @@ -15,7 +16,11 @@ import com.red.circle.other.app.dto.cmd.team.TeamMemberWalletWithdrawalCmd; import com.red.circle.other.app.dto.cmd.team.TeamUserApplyCmd; import com.red.circle.other.app.dto.cmd.team.TeamUserApplyRecordQryCmd; import com.red.circle.other.app.service.team.TeamService; +import com.red.circle.other.infra.database.rds.service.sys.AdministratorAuthService; +import com.red.circle.other.inner.asserts.team.TeamErrorCode; +import com.red.circle.other.inner.endpoint.team.target.TeamProfileClient; import com.red.circle.other.inner.enums.team.TeamUserIdentity; +import com.red.circle.other.inner.model.cmd.team.TeamCreateCmd; import com.red.circle.other.inner.model.dto.user.UserProfileDTO; import java.util.List; import lombok.RequiredArgsConstructor; @@ -43,6 +48,8 @@ import org.springframework.web.bind.annotation.RestController; public class TeamRestController extends BaseController { private final TeamService teamService; + private final TeamProfileClient teamProfileClient; + private final AdministratorAuthService administratorAuthService; /** * 成员进入团队. @@ -474,4 +481,16 @@ public class TeamRestController extends BaseController { return teamService.existsMessageTips(cmd); } + /** + * 创建代理 + */ + @PostMapping("/create") + public void createTeam(@Validated TeamCreateCmd cmd) { + // APP管理员权限校验 + List authResources = administratorAuthService.listAuthResources(cmd.getReqUserId()); + ResponseAssert.isTrue(TeamErrorCode.ADMIN_PERMISSION_INSUFFICIENT, authResources.contains("TEAM_CREATE")); + + teamProfileClient.createTeam(cmd); + } + }