diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemVersionController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemVersionController.java index 99bc5295d5..f17a2e63cc 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemVersionController.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemVersionController.java @@ -1,11 +1,14 @@ package io.metersphere.system.controller; import io.metersphere.system.service.SystemVersionService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +@Tag(name = "系统版本") @RequestMapping("/system/version") @RestController public class SystemVersionController { @@ -14,6 +17,7 @@ public class SystemVersionController { private SystemVersionService systemVersionService; @GetMapping("/current") + @Operation(summary = "获取当前系统版本") public String getVersion() { return systemVersionService.getVersion(); } diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/TestResourcePoolController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/TestResourcePoolController.java index d4b0b1c63a..76a4f58888 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/TestResourcePoolController.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/TestResourcePoolController.java @@ -15,6 +15,8 @@ import io.metersphere.sdk.util.Pager; import io.metersphere.sdk.util.SessionUtils; import io.metersphere.system.consul.CacheNode; import io.metersphere.system.domain.TestResourcePool; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.validation.annotation.Validated; @@ -22,7 +24,7 @@ import org.springframework.web.bind.annotation.*; import java.util.List; - +@Tag(name = "系统资源池") @RequestMapping("/test/resource/pool") @RestController public class TestResourcePoolController { @@ -31,6 +33,7 @@ public class TestResourcePoolController { private TestResourcePoolService testResourcePoolService; @PostMapping("/add") + @Operation(summary = "添加资源池") @RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ_ADD) @Log(type = OperationLogType.ADD, expression = "#msClass.addLog(#request)", msClass = TestResourcePoolService.class) public TestResourcePool addTestResourcePool(@Validated @RequestBody TestResourcePoolRequest request) { @@ -44,6 +47,7 @@ public class TestResourcePoolController { @GetMapping("/delete/{poolId}") @CacheNode // 把监控节点缓存起来 + @Operation(summary = "删除资源池") @RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ_DELETE) @Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#testResourcePoolId)", msClass = TestResourcePoolService.class) public void deleteTestResourcePool(@PathVariable(value = "poolId") String testResourcePoolId) { @@ -52,6 +56,7 @@ public class TestResourcePoolController { @PostMapping("/update") @CacheNode // 把监控节点缓存起来 + @Operation(summary = "更新资源池") @RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ_UPDATE) @Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#request)", msClass = TestResourcePoolService.class) public void updateTestResourcePool(@Validated @RequestBody TestResourcePoolRequest request) { @@ -63,6 +68,7 @@ public class TestResourcePoolController { } @PostMapping("/page") + @Operation(summary = "获取资源池列表") @RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ) public Pager> listResourcePools(@Validated @RequestBody QueryResourcePoolRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), true); @@ -70,6 +76,7 @@ public class TestResourcePoolController { } @GetMapping("/detail/{poolId}") + @Operation(summary = "查看资源池详细") @RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ) public TestResourcePoolDTO getTestResourcePoolDetail(@PathVariable(value = "poolId") String testResourcePoolId) { return testResourcePoolService.getTestResourcePoolDetail(testResourcePoolId); diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemVersionControllerTest.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemVersionControllerTests.java similarity index 85% rename from backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemVersionControllerTest.java rename to backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemVersionControllerTests.java index 8378c65753..7058923297 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemVersionControllerTest.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemVersionControllerTests.java @@ -2,8 +2,6 @@ package io.metersphere.system.controller; import base.BaseTest; import io.metersphere.sdk.constants.SessionConstants; -import io.metersphere.sdk.dto.QueryResourcePoolRequest; -import io.metersphere.sdk.util.JSON; import jakarta.annotation.Resource; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; @@ -16,13 +14,12 @@ import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @SpringBootTest @AutoConfigureMockMvc @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public class SystemVersionControllerTest extends BaseTest { +public class SystemVersionControllerTests extends BaseTest { @Resource private MockMvc mockMvc; diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/TestResourcePoolControllerTest.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/TestResourcePoolControllerTests.java similarity index 99% rename from backend/services/system-setting/src/test/java/io/metersphere/system/controller/TestResourcePoolControllerTest.java rename to backend/services/system-setting/src/test/java/io/metersphere/system/controller/TestResourcePoolControllerTests.java index 561dfa05f3..c585d43029 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/TestResourcePoolControllerTest.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/TestResourcePoolControllerTests.java @@ -38,7 +38,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @SpringBootTest @AutoConfigureMockMvc @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -class TestResourcePoolControllerTest extends BaseTest { +class TestResourcePoolControllerTests extends BaseTest { @Resource private MockMvc mockMvc;