新增创建代理 接口
This commit is contained in:
parent
23b266e8e0
commit
258d857026
@ -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;
|
||||
|
||||
@ -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<String> authResources = administratorAuthService.listAuthResources(cmd.getReqUserId());
|
||||
ResponseAssert.isTrue(TeamErrorCode.ADMIN_PERMISSION_INSUFFICIENT, authResources.contains("TEAM_CREATE"));
|
||||
|
||||
teamProfileClient.createTeam(cmd);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user