refactor: 补充接口描述信息

This commit is contained in:
jianxing 2023-08-25 17:14:51 +08:00 committed by 刘瑞斌
parent fe9c3ea07f
commit b1c1d05735
5 changed files with 27 additions and 29 deletions

View File

@ -26,7 +26,7 @@ import java.util.List;
* @author : jianxing * @author : jianxing
* @date : 2023-6-9 * @date : 2023-6-9
*/ */
@Tag(name = "全局用户组") @Tag(name = "系统设置-用户组")
@RestController @RestController
@RequestMapping("/user/role/global") @RequestMapping("/user/role/global")
public class GlobalUserRoleController { public class GlobalUserRoleController {
@ -35,21 +35,21 @@ public class GlobalUserRoleController {
private GlobalUserRoleService globalUserRoleService; private GlobalUserRoleService globalUserRoleService;
@GetMapping("/list") @GetMapping("/list")
@Operation(summary = "获取全局用户组列表") @Operation(summary = "系统设置-用户组-获取全局用户组列表")
@RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_READ) @RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_READ)
public List<UserRole> list() { public List<UserRole> list() {
return globalUserRoleService.list(); return globalUserRoleService.list();
} }
@GetMapping("/permission/setting/{id}") @GetMapping("/permission/setting/{id}")
@Operation(summary = "获取全局用户组对应的权限配置") @Operation(summary = "系统设置-用户组-获取全局用户组对应的权限配置")
@RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_READ) @RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_READ)
public List<PermissionDefinitionItem> getPermissionSetting(@PathVariable String id) { public List<PermissionDefinitionItem> getPermissionSetting(@PathVariable String id) {
return globalUserRoleService.getPermissionSetting(id); return globalUserRoleService.getPermissionSetting(id);
} }
@PostMapping("/permission/update") @PostMapping("/permission/update")
@Operation(summary = "编辑全局用户组对应的权限配置") @Operation(summary = "系统设置-用户组-编辑全局用户组对应的权限配置")
@RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_UPDATE) @RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_UPDATE)
@Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#request)", msClass = GlobalUserRoleLogService.class) @Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#request)", msClass = GlobalUserRoleLogService.class)
public void updatePermissionSetting(@Validated @RequestBody PermissionSettingUpdateRequest request) { public void updatePermissionSetting(@Validated @RequestBody PermissionSettingUpdateRequest request) {
@ -57,7 +57,7 @@ public class GlobalUserRoleController {
} }
@PostMapping("/add") @PostMapping("/add")
@Operation(summary = "添加自定义全局用户组") @Operation(summary = "系统设置-用户组-添加自定义全局用户组")
@RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_ADD) @RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_ADD)
@Log(type = OperationLogType.ADD, expression = "#msClass.addLog(#request)", msClass = GlobalUserRoleLogService.class) @Log(type = OperationLogType.ADD, expression = "#msClass.addLog(#request)", msClass = GlobalUserRoleLogService.class)
public UserRole add(@Validated({Created.class}) @RequestBody UserRoleUpdateRequest request) { public UserRole add(@Validated({Created.class}) @RequestBody UserRoleUpdateRequest request) {
@ -68,7 +68,7 @@ public class GlobalUserRoleController {
} }
@PostMapping("/update") @PostMapping("/update")
@Operation(summary = "更新自定义全局用户组") @Operation(summary = "系统设置-用户组-更新自定义全局用户组")
@RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_UPDATE) @RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_UPDATE)
@Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#request)", msClass = GlobalUserRoleLogService.class) @Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#request)", msClass = GlobalUserRoleLogService.class)
public UserRole update(@Validated({Updated.class}) @RequestBody UserRoleUpdateRequest request) { public UserRole update(@Validated({Updated.class}) @RequestBody UserRoleUpdateRequest request) {
@ -78,7 +78,7 @@ public class GlobalUserRoleController {
} }
@GetMapping("/delete/{id}") @GetMapping("/delete/{id}")
@Operation(summary = "删除自定义全局用户组") @Operation(summary = "系统设置-用户组-删除自定义全局用户组")
@RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_DELETE) @RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_DELETE)
@Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#id)", msClass = GlobalUserRoleLogService.class) @Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#id)", msClass = GlobalUserRoleLogService.class)
public void delete(@PathVariable String id) { public void delete(@PathVariable String id) {

View File

@ -31,7 +31,7 @@ import java.util.List;
* @date : 2023-6-12 * @date : 2023-6-12
*/ */
@RestController @RestController
@Tag(name = "全局用户组与用户的关联关系") @Tag(name = "系统设置-用户组与用户关联关系")
@RequestMapping("/user/role/relation/global") @RequestMapping("/user/role/relation/global")
public class GlobalUserRoleRelationController { public class GlobalUserRoleRelationController {
@ -39,7 +39,7 @@ public class GlobalUserRoleRelationController {
private GlobalUserRoleRelationService globalUserRoleRelationService; private GlobalUserRoleRelationService globalUserRoleRelationService;
@PostMapping("/list") @PostMapping("/list")
@Operation(summary = "获取全局用户组对应的用户列表") @Operation(summary = "系统设置-用户组与用户关联关系-获取全局用户组对应的用户列表")
@RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_READ) @RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_READ)
public Pager<List<UserRoleRelationUserDTO>> list(@Validated @RequestBody GlobalUserRoleRelationQueryRequest request) { public Pager<List<UserRoleRelationUserDTO>> list(@Validated @RequestBody GlobalUserRoleRelationQueryRequest request) {
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), true); Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), true);
@ -47,7 +47,7 @@ public class GlobalUserRoleRelationController {
} }
@PostMapping("/add") @PostMapping("/add")
@Operation(summary = "创建全局用户组和用户的关联关系") @Operation(summary = "系统设置-用户组与用户关联关系-创建全局用户组和用户的关联关系")
@RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_UPDATE) @RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_UPDATE)
@Log(type = OperationLogType.ADD, expression = "#msClass.addLog(#request)", msClass = GlobalUserRoleRelationLogService.class) @Log(type = OperationLogType.ADD, expression = "#msClass.addLog(#request)", msClass = GlobalUserRoleRelationLogService.class)
public void add(@Validated({Created.class}) @RequestBody GlobalUserRoleRelationUpdateRequest request) { public void add(@Validated({Created.class}) @RequestBody GlobalUserRoleRelationUpdateRequest request) {
@ -56,7 +56,7 @@ public class GlobalUserRoleRelationController {
} }
@GetMapping("/delete/{id}") @GetMapping("/delete/{id}")
@Operation(summary = "删除全局用户组和用户的关联关系") @Operation(summary = "系统设置-用户组与用户关联关系-删除全局用户组和用户的关联关系")
@RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_UPDATE) @RequiresPermissions(PermissionConstants.SYSTEM_USER_ROLE_UPDATE)
@Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#id)", msClass = GlobalUserRoleRelationLogService.class) @Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#id)", msClass = GlobalUserRoleRelationLogService.class)
public void delete(@PathVariable String id) { public void delete(@PathVariable String id) {
@ -64,7 +64,7 @@ public class GlobalUserRoleRelationController {
} }
@GetMapping("/user/option/{roleId}") @GetMapping("/user/option/{roleId}")
@Operation(summary = "系统用户组-用户下拉选项") @Operation(summary = "系统设置-用户组与用户关联关系-获取需要关联的用户选项")
@RequiresPermissions(value = {PermissionConstants.SYSTEM_USER_ROLE_READ}) @RequiresPermissions(value = {PermissionConstants.SYSTEM_USER_ROLE_READ})
public List<ExcludeOptionDTO> getSelectOption(@Parameter(description = "用户组ID", schema = @Schema(requiredMode = Schema.RequiredMode.REQUIRED)) public List<ExcludeOptionDTO> getSelectOption(@Parameter(description = "用户组ID", schema = @Schema(requiredMode = Schema.RequiredMode.REQUIRED))
@PathVariable String roleId) { @PathVariable String roleId) {

View File

@ -31,21 +31,21 @@ import java.util.List;
*/ */
@RestController @RestController
@RequestMapping("/plugin") @RequestMapping("/plugin")
@Tag(name = "插件") @Tag(name = "系统设置-插件")
public class PluginController { public class PluginController {
@Resource @Resource
private PluginService pluginService; private PluginService pluginService;
@GetMapping("/list") @GetMapping("/list")
@Operation(summary = "获取插件列表") @Operation(summary = "系统设置-插件-获取插件列表")
@RequiresPermissions(PermissionConstants.SYSTEM_PLUGIN_READ) @RequiresPermissions(PermissionConstants.SYSTEM_PLUGIN_READ)
public List<PluginDTO> list() { public List<PluginDTO> list() {
return pluginService.list(); return pluginService.list();
} }
@PostMapping("/add") @PostMapping("/add")
@Operation(summary = "创建插件") @Operation(summary = "系统设置-插件-创建插件")
@RequiresPermissions(PermissionConstants.SYSTEM_PLUGIN_ADD) @RequiresPermissions(PermissionConstants.SYSTEM_PLUGIN_ADD)
@Log(type = OperationLogType.UPDATE, expression = "#msClass.addLog(#request)", msClass = PluginLogService.class) @Log(type = OperationLogType.UPDATE, expression = "#msClass.addLog(#request)", msClass = PluginLogService.class)
public Plugin add(@Validated({Created.class}) @RequestPart(value = "request") PluginUpdateRequest request, public Plugin add(@Validated({Created.class}) @RequestPart(value = "request") PluginUpdateRequest request,
@ -55,7 +55,7 @@ public class PluginController {
} }
@PostMapping("/update") @PostMapping("/update")
@Operation(summary = "更新插件") @Operation(summary = "系统设置-插件-更新插件")
@RequiresPermissions(PermissionConstants.SYSTEM_PLUGIN_UPDATE) @RequiresPermissions(PermissionConstants.SYSTEM_PLUGIN_UPDATE)
@Log(type = OperationLogType.ADD, expression = "#msClass.updateLog(#request)", msClass = PluginLogService.class) @Log(type = OperationLogType.ADD, expression = "#msClass.updateLog(#request)", msClass = PluginLogService.class)
public Plugin update(@Validated({Updated.class}) @RequestBody PluginUpdateRequest request) { public Plugin update(@Validated({Updated.class}) @RequestBody PluginUpdateRequest request) {
@ -65,7 +65,7 @@ public class PluginController {
} }
@GetMapping("/delete/{id}") @GetMapping("/delete/{id}")
@Operation(summary = "删除插件") @Operation(summary = "系统设置-插件-删除插件")
@RequiresPermissions(PermissionConstants.SYSTEM_PLUGIN_DELETE) @RequiresPermissions(PermissionConstants.SYSTEM_PLUGIN_DELETE)
@Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#id)", msClass = PluginLogService.class) @Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#id)", msClass = PluginLogService.class)
public void delete(@PathVariable String id) { public void delete(@PathVariable String id) {
@ -73,13 +73,14 @@ public class PluginController {
} }
@GetMapping("/script/get/{pluginId}/{scriptId}") @GetMapping("/script/get/{pluginId}/{scriptId}")
@Operation(summary = "获取插件对应表单的脚本内容") @Operation(summary = "系统设置-插件-获取插件对应表单的脚本内容")
@RequiresPermissions(PermissionConstants.SYSTEM_PLUGIN_READ) @RequiresPermissions(PermissionConstants.SYSTEM_PLUGIN_READ)
public String getScript(@PathVariable String pluginId, @PathVariable String scriptId) { public String getScript(@PathVariable String pluginId, @PathVariable String scriptId) {
return pluginService.getScript(pluginId, scriptId); return pluginService.getScript(pluginId, scriptId);
} }
@GetMapping("/image/{pluginId}") @GetMapping("/image/{pluginId}")
@Operation(summary = "系统设置-插件-获取插件的图片资源")
public void getPluginImg( public void getPluginImg(
@Schema(description = "插件ID", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "插件ID", requiredMode = Schema.RequiredMode.REQUIRED)
@PathVariable("pluginId") @PathVariable("pluginId")

View File

@ -28,21 +28,21 @@ import java.util.List;
*/ */
@RestController @RestController
@RequestMapping("/service/integration") @RequestMapping("/service/integration")
@Tag(name = "服务集成") @Tag(name = "组织-服务集成")
public class ServiceIntegrationController { public class ServiceIntegrationController {
@Resource @Resource
private ServiceIntegrationService serviceIntegrationService; private ServiceIntegrationService serviceIntegrationService;
@GetMapping("/list/{organizationId}") @GetMapping("/list/{organizationId}")
@Operation(summary = "获取服务集成列表") @Operation(summary = "组织-服务集成-获取服务集成列表")
@RequiresPermissions(PermissionConstants.SYSTEM_SERVICE_INTEGRATION_READ) @RequiresPermissions(PermissionConstants.SYSTEM_SERVICE_INTEGRATION_READ)
public List<ServiceIntegrationDTO> list(@PathVariable String organizationId) { public List<ServiceIntegrationDTO> list(@PathVariable String organizationId) {
return serviceIntegrationService.list(organizationId); return serviceIntegrationService.list(organizationId);
} }
@PostMapping("/add") @PostMapping("/add")
@Operation(summary = "创建服务集成") @Operation(summary = "组织-服务集成-创建服务集成")
@RequiresPermissions(PermissionConstants.SYSTEM_SERVICE_INTEGRATION_ADD) @RequiresPermissions(PermissionConstants.SYSTEM_SERVICE_INTEGRATION_ADD)
@Log(type = OperationLogType.UPDATE, expression = "#msClass.addLog(#request)", msClass = ServiceIntegrationLogService.class) @Log(type = OperationLogType.UPDATE, expression = "#msClass.addLog(#request)", msClass = ServiceIntegrationLogService.class)
public ServiceIntegration add(@Validated({Created.class}) @RequestBody ServiceIntegrationUpdateRequest request) { public ServiceIntegration add(@Validated({Created.class}) @RequestBody ServiceIntegrationUpdateRequest request) {
@ -50,7 +50,7 @@ public class ServiceIntegrationController {
} }
@PostMapping("/update") @PostMapping("/update")
@Operation(summary = "更新服务集成") @Operation(summary = "组织-服务集成-更新服务集成")
@RequiresPermissions(PermissionConstants.SYSTEM_SERVICE_INTEGRATION_UPDATE) @RequiresPermissions(PermissionConstants.SYSTEM_SERVICE_INTEGRATION_UPDATE)
@Log(type = OperationLogType.ADD, expression = "#msClass.updateLog(#request)", msClass = ServiceIntegrationLogService.class) @Log(type = OperationLogType.ADD, expression = "#msClass.updateLog(#request)", msClass = ServiceIntegrationLogService.class)
public ServiceIntegration update(@Validated({Updated.class}) @RequestBody ServiceIntegrationUpdateRequest request) { public ServiceIntegration update(@Validated({Updated.class}) @RequestBody ServiceIntegrationUpdateRequest request) {
@ -58,7 +58,7 @@ public class ServiceIntegrationController {
} }
@GetMapping("/delete/{id}") @GetMapping("/delete/{id}")
@Operation(summary = "删除服务集成") @Operation(summary = "组织-服务集成-删除服务集成")
@RequiresPermissions(PermissionConstants.SYSTEM_SERVICE_INTEGRATION_DELETE) @RequiresPermissions(PermissionConstants.SYSTEM_SERVICE_INTEGRATION_DELETE)
@Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#id)", msClass = ServiceIntegrationLogService.class) @Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#id)", msClass = ServiceIntegrationLogService.class)
public void delete(@PathVariable String id) { public void delete(@PathVariable String id) {
@ -66,7 +66,7 @@ public class ServiceIntegrationController {
} }
@PostMapping("/validate/{pluginId}") @PostMapping("/validate/{pluginId}")
@Operation(summary = "校验服务集成信息") @Operation(summary = "组织-服务集成-校验服务集成信息")
@RequiresPermissions(PermissionConstants.SYSTEM_SERVICE_INTEGRATION_UPDATE) @RequiresPermissions(PermissionConstants.SYSTEM_SERVICE_INTEGRATION_UPDATE)
public void validate(@PathVariable String pluginId, public void validate(@PathVariable String pluginId,
@Validated({Updated.class}) @Validated({Updated.class})
@ -78,14 +78,14 @@ public class ServiceIntegrationController {
} }
@GetMapping("/validate/{id}") @GetMapping("/validate/{id}")
@Operation(summary = "校验服务集成信息") @Operation(summary = "组织-服务集成-校验服务集成信息")
@RequiresPermissions(PermissionConstants.SYSTEM_SERVICE_INTEGRATION_UPDATE) @RequiresPermissions(PermissionConstants.SYSTEM_SERVICE_INTEGRATION_UPDATE)
public void validate(@PathVariable String id) { public void validate(@PathVariable String id) {
serviceIntegrationService.validate(id); serviceIntegrationService.validate(id);
} }
@GetMapping("/script/{pluginId}") @GetMapping("/script/{pluginId}")
@Operation(summary = "获取前端配置脚本") @Operation(summary = "组织-服务集成-获取前端配置脚本")
@RequiresPermissions(PermissionConstants.SYSTEM_SERVICE_INTEGRATION_READ) @RequiresPermissions(PermissionConstants.SYSTEM_SERVICE_INTEGRATION_READ)
public Object getPluginScript(@PathVariable String pluginId) { public Object getPluginScript(@PathVariable String pluginId) {
return serviceIntegrationService.getPluginScript(pluginId); return serviceIntegrationService.getPluginScript(pluginId);

View File

@ -12,7 +12,6 @@ import io.metersphere.system.controller.param.PluginUpdateRequestDefinition;
import io.metersphere.system.domain.*; import io.metersphere.system.domain.*;
import io.metersphere.system.dto.OrganizationDTO; import io.metersphere.system.dto.OrganizationDTO;
import io.metersphere.system.dto.PluginDTO; import io.metersphere.system.dto.PluginDTO;
import io.metersphere.system.mapper.ExtPluginMapper;
import io.metersphere.system.mapper.PluginMapper; import io.metersphere.system.mapper.PluginMapper;
import io.metersphere.system.mapper.PluginOrganizationMapper; import io.metersphere.system.mapper.PluginOrganizationMapper;
import io.metersphere.system.mapper.PluginScriptMapper; import io.metersphere.system.mapper.PluginScriptMapper;
@ -48,8 +47,6 @@ public class PluginControllerTests extends BaseTest {
@Resource @Resource
private PluginMapper pluginMapper; private PluginMapper pluginMapper;
@Resource @Resource
private ExtPluginMapper extPluginMapper;
@Resource
private BaseUserService baseUserService; private BaseUserService baseUserService;
@Resource @Resource
private PluginOrganizationMapper pluginOrganizationMapper; private PluginOrganizationMapper pluginOrganizationMapper;