refactor: add describe

This commit is contained in:
guoyuqi 2023-08-25 16:08:37 +08:00 committed by 刘瑞斌
parent 0e8d916097
commit df28f03920
2 changed files with 17 additions and 17 deletions

View File

@ -30,7 +30,7 @@ import java.util.List;
/** /**
* @author guoyuqi * @author guoyuqi
*/ */
@Tag(name = "组织-成员") @Tag(name = "系统设置-组织-成员")
@RestController @RestController
@RequestMapping("/organization") @RequestMapping("/organization")
public class OrganizationController { public class OrganizationController {
@ -39,7 +39,7 @@ public class OrganizationController {
private OrganizationService organizationService; private OrganizationService organizationService;
@PostMapping("/member/list") @PostMapping("/member/list")
@Operation(summary = "组织级别获取组织成员") @Operation(summary = "系统设置-组织-成员-获取组织成员列表")
@RequiresPermissions(PermissionConstants.ORGANIZATION_MEMBER_READ) @RequiresPermissions(PermissionConstants.ORGANIZATION_MEMBER_READ)
public Pager<List<OrgUserExtend>> getMemberList(@Validated @RequestBody OrganizationRequest organizationRequest) { public Pager<List<OrgUserExtend>> getMemberList(@Validated @RequestBody OrganizationRequest organizationRequest) {
Page<Object> page = PageHelper.startPage(organizationRequest.getCurrent(), organizationRequest.getPageSize()); Page<Object> page = PageHelper.startPage(organizationRequest.getCurrent(), organizationRequest.getPageSize());
@ -47,35 +47,35 @@ public class OrganizationController {
} }
@PostMapping("/add-member") @PostMapping("/add-member")
@Operation(summary = "添加组织成员") @Operation(summary = "系统设置-组织-成员-添加组织成员")
@RequiresPermissions(PermissionConstants.ORGANIZATION_MEMBER_ADD) @RequiresPermissions(PermissionConstants.ORGANIZATION_MEMBER_ADD)
public void addMemberByList(@Validated @RequestBody OrganizationMemberExtendRequest organizationMemberExtendRequest) { public void addMemberByList(@Validated @RequestBody OrganizationMemberExtendRequest organizationMemberExtendRequest) {
organizationService.addMemberByOrg(organizationMemberExtendRequest, SessionUtils.getUserId()); organizationService.addMemberByOrg(organizationMemberExtendRequest, SessionUtils.getUserId());
} }
@PostMapping("/role/update-member") @PostMapping("/role/update-member")
@Operation(summary = "添加组织成员至用户组") @Operation(summary = "系统设置-组织-成员-添加组织成员至用户组")
@RequiresPermissions(PermissionConstants.ORGANIZATION_MEMBER_UPDATE) @RequiresPermissions(PermissionConstants.ORGANIZATION_MEMBER_UPDATE)
public void addMemberRole(@Validated @RequestBody OrganizationMemberExtendRequest organizationMemberExtendRequest) { public void addMemberRole(@Validated @RequestBody OrganizationMemberExtendRequest organizationMemberExtendRequest) {
organizationService.addMemberRole(organizationMemberExtendRequest, SessionUtils.getUserId()); organizationService.addMemberRole(organizationMemberExtendRequest, SessionUtils.getUserId());
} }
@PostMapping("/update-member") @PostMapping("/update-member")
@Operation(summary = "更新用户") @Operation(summary = "系统设置-组织-成员-更新用户")
@RequiresPermissions(value = {PermissionConstants.ORGANIZATION_MEMBER_UPDATE, PermissionConstants.PROJECT_USER_READ_ADD, PermissionConstants.PROJECT_USER_READ_DELETE}, logical = Logical.OR) @RequiresPermissions(value = {PermissionConstants.ORGANIZATION_MEMBER_UPDATE, PermissionConstants.PROJECT_USER_READ_ADD, PermissionConstants.PROJECT_USER_READ_DELETE}, logical = Logical.OR)
public void updateMember(@Validated @RequestBody OrganizationMemberUpdateRequest organizationMemberExtendRequest) { public void updateMember(@Validated @RequestBody OrganizationMemberUpdateRequest organizationMemberExtendRequest) {
organizationService.updateMember(organizationMemberExtendRequest, SessionUtils.getUserId()); organizationService.updateMember(organizationMemberExtendRequest, SessionUtils.getUserId());
} }
@PostMapping("/project/add-member") @PostMapping("/project/add-member")
@Operation(summary = "添加组织成员至项目") @Operation(summary = "系统设置-组织-成员-添加组织成员至项目")
@RequiresPermissions(value = {PermissionConstants.ORGANIZATION_MEMBER_UPDATE, PermissionConstants.PROJECT_USER_READ_ADD}) @RequiresPermissions(value = {PermissionConstants.ORGANIZATION_MEMBER_UPDATE, PermissionConstants.PROJECT_USER_READ_ADD})
public void addMemberToProject(@Validated @RequestBody OrgMemberExtendProjectRequest orgMemberExtendProjectRequest) { public void addMemberToProject(@Validated @RequestBody OrgMemberExtendProjectRequest orgMemberExtendProjectRequest) {
organizationService.addMemberToProject(orgMemberExtendProjectRequest, SessionUtils.getUserId()); organizationService.addMemberToProject(orgMemberExtendProjectRequest, SessionUtils.getUserId());
} }
@GetMapping("/remove-member/{organizationId}/{userId}") @GetMapping("/remove-member/{organizationId}/{userId}")
@Operation(summary = "删除组织成员") @Operation(summary = "系统设置-组织-成员-删除组织成员")
@Parameters({ @Parameters({
@Parameter(name = "organizationId", description = "组织ID", schema = @Schema(requiredMode = Schema.RequiredMode.REQUIRED)), @Parameter(name = "organizationId", description = "组织ID", schema = @Schema(requiredMode = Schema.RequiredMode.REQUIRED)),
@Parameter(name = "userId", description = "成员ID", schema = @Schema(requiredMode = Schema.RequiredMode.REQUIRED)) @Parameter(name = "userId", description = "成员ID", schema = @Schema(requiredMode = Schema.RequiredMode.REQUIRED))
@ -87,21 +87,21 @@ public class OrganizationController {
} }
@GetMapping("/project/list/{organizationId}") @GetMapping("/project/list/{organizationId}")
@Operation(summary = "获取当前组织下的所有项目") @Operation(summary = "系统设置-组织-成员-获取当前组织下的所有项目")
@RequiresPermissions(PermissionConstants.ORGANIZATION_PROJECT_READ) @RequiresPermissions(PermissionConstants.ORGANIZATION_PROJECT_READ)
public List<IdNameStructureDTO> getProjectList(@PathVariable(value = "organizationId") String organizationId) { public List<IdNameStructureDTO> getProjectList(@PathVariable(value = "organizationId") String organizationId) {
return organizationService.getProjectList(organizationId); return organizationService.getProjectList(organizationId);
} }
@GetMapping("/user/role/list/{organizationId}") @GetMapping("/user/role/list/{organizationId}")
@Operation(summary = "获取当前组织下的所有自定义用户组以及组织级别的用户组") @Operation(summary = "系统设置-组织-成员-获取当前组织下的所有自定义用户组以及组织级别的用户组")
@RequiresPermissions(PermissionConstants.ORGANIZATION_MEMBER_READ) @RequiresPermissions(PermissionConstants.ORGANIZATION_MEMBER_READ)
public List<IdNameStructureDTO> getUserRoleList(@PathVariable(value = "organizationId") String organizationId) { public List<IdNameStructureDTO> getUserRoleList(@PathVariable(value = "organizationId") String organizationId) {
return organizationService.getUserRoleList(organizationId); return organizationService.getUserRoleList(organizationId);
} }
@GetMapping("/not-exist/user/list/{organizationId}") @GetMapping("/not-exist/user/list/{organizationId}")
@Operation(summary = "获取不在当前组织的所有用户") @Operation(summary = "系统设置-组织-成员-获取不在当前组织的所有用户")
@RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_READ) @RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_READ)
public List<IdNameStructureDTO> getUserList(@PathVariable(value = "organizationId") String organizationId) { public List<IdNameStructureDTO> getUserList(@PathVariable(value = "organizationId") String organizationId) {
return organizationService.getUserList(organizationId); return organizationService.getUserList(organizationId);

View File

@ -27,7 +27,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
@Tag(name = "系统资源池") @Tag(name = "系统设置-系统-资源池")
@RequestMapping("/test/resource/pool") @RequestMapping("/test/resource/pool")
@RestController @RestController
public class TestResourcePoolController { public class TestResourcePoolController {
@ -36,7 +36,7 @@ public class TestResourcePoolController {
private TestResourcePoolService testResourcePoolService; private TestResourcePoolService testResourcePoolService;
@PostMapping("/add") @PostMapping("/add")
@Operation(summary = "添加资源池") @Operation(summary = "系统设置-系统-资源池-添加资源池")
@RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ_ADD) @RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ_ADD)
@Log(type = OperationLogType.ADD, expression = "#msClass.addLog(#request)", msClass = TestResourcePoolService.class) @Log(type = OperationLogType.ADD, expression = "#msClass.addLog(#request)", msClass = TestResourcePoolService.class)
public TestResourcePool addTestResourcePool(@Validated({Created.class}) @RequestBody TestResourcePoolRequest request) { public TestResourcePool addTestResourcePool(@Validated({Created.class}) @RequestBody TestResourcePoolRequest request) {
@ -50,7 +50,7 @@ public class TestResourcePoolController {
@GetMapping("/delete/{poolId}") @GetMapping("/delete/{poolId}")
@CacheNode // 把监控节点缓存起来 @CacheNode // 把监控节点缓存起来
@Operation(summary = "删除资源池") @Operation(summary = "系统设置-系统-资源池-删除资源池")
@RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ_DELETE) @RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ_DELETE)
@Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#testResourcePoolId)", msClass = TestResourcePoolService.class) @Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#testResourcePoolId)", msClass = TestResourcePoolService.class)
public void deleteTestResourcePool(@PathVariable(value = "poolId") String testResourcePoolId) { public void deleteTestResourcePool(@PathVariable(value = "poolId") String testResourcePoolId) {
@ -59,7 +59,7 @@ public class TestResourcePoolController {
@PostMapping("/update") @PostMapping("/update")
@CacheNode // 把监控节点缓存起来 @CacheNode // 把监控节点缓存起来
@Operation(summary = "更新资源池") @Operation(summary = "系统设置-系统-资源池-更新资源池")
@RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ_UPDATE) @RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ_UPDATE)
@Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#request.getId())", msClass = TestResourcePoolService.class) @Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#request.getId())", msClass = TestResourcePoolService.class)
public void updateTestResourcePool(@Validated({Updated.class}) @RequestBody TestResourcePoolRequest request) { public void updateTestResourcePool(@Validated({Updated.class}) @RequestBody TestResourcePoolRequest request) {
@ -71,7 +71,7 @@ public class TestResourcePoolController {
} }
@PostMapping("/page") @PostMapping("/page")
@Operation(summary = "获取资源池列表") @Operation(summary = "系统设置-系统-资源池-获取资源池列表")
@RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ) @RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ)
public Pager<List<TestResourcePoolDTO>> listResourcePools(@Validated @RequestBody QueryResourcePoolRequest request) { public Pager<List<TestResourcePoolDTO>> listResourcePools(@Validated @RequestBody QueryResourcePoolRequest request) {
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), true); Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), true);
@ -79,14 +79,14 @@ public class TestResourcePoolController {
} }
@GetMapping("/detail/{poolId}") @GetMapping("/detail/{poolId}")
@Operation(summary = "查看资源池详细") @Operation(summary = "系统-资源池-查看资源池详细")
@RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ) @RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ)
public TestResourcePoolReturnDTO getTestResourcePoolDetail(@PathVariable(value = "poolId") String testResourcePoolId) { public TestResourcePoolReturnDTO getTestResourcePoolDetail(@PathVariable(value = "poolId") String testResourcePoolId) {
return testResourcePoolService.getTestResourcePoolDetail(testResourcePoolId); return testResourcePoolService.getTestResourcePoolDetail(testResourcePoolId);
} }
@PostMapping("/set/enable/{poolId}") @PostMapping("/set/enable/{poolId}")
@Operation(summary = "资源池禁用") @Operation(summary = "系统设置-系统-资源池-资源池禁用")
@RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ_UPDATE) @RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ_UPDATE)
@Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#testResourcePoolId)", msClass = TestResourcePoolService.class) @Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#testResourcePoolId)", msClass = TestResourcePoolService.class)
public void unableTestResourcePool(@PathVariable(value = "poolId") String testResourcePoolId) { public void unableTestResourcePool(@PathVariable(value = "poolId") String testResourcePoolId) {