refactor: change package name
This commit is contained in:
parent
109a8026d2
commit
9c4244ea2a
|
@ -1,11 +1,14 @@
|
||||||
package io.metersphere.system.controller;
|
package io.metersphere.system.controller;
|
||||||
|
|
||||||
import io.metersphere.system.service.SystemVersionService;
|
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 jakarta.annotation.Resource;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Tag(name = "系统版本")
|
||||||
@RequestMapping("/system/version")
|
@RequestMapping("/system/version")
|
||||||
@RestController
|
@RestController
|
||||||
public class SystemVersionController {
|
public class SystemVersionController {
|
||||||
|
@ -14,6 +17,7 @@ public class SystemVersionController {
|
||||||
private SystemVersionService systemVersionService;
|
private SystemVersionService systemVersionService;
|
||||||
|
|
||||||
@GetMapping("/current")
|
@GetMapping("/current")
|
||||||
|
@Operation(summary = "获取当前系统版本")
|
||||||
public String getVersion() {
|
public String getVersion() {
|
||||||
return systemVersionService.getVersion();
|
return systemVersionService.getVersion();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,8 @@ import io.metersphere.sdk.util.Pager;
|
||||||
import io.metersphere.sdk.util.SessionUtils;
|
import io.metersphere.sdk.util.SessionUtils;
|
||||||
import io.metersphere.system.consul.CacheNode;
|
import io.metersphere.system.consul.CacheNode;
|
||||||
import io.metersphere.system.domain.TestResourcePool;
|
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 jakarta.annotation.Resource;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
@ -22,7 +24,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@Tag(name = "系统资源池")
|
||||||
@RequestMapping("/test/resource/pool")
|
@RequestMapping("/test/resource/pool")
|
||||||
@RestController
|
@RestController
|
||||||
public class TestResourcePoolController {
|
public class TestResourcePoolController {
|
||||||
|
@ -31,6 +33,7 @@ public class TestResourcePoolController {
|
||||||
private TestResourcePoolService testResourcePoolService;
|
private TestResourcePoolService testResourcePoolService;
|
||||||
|
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
|
@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 @RequestBody TestResourcePoolRequest request) {
|
public TestResourcePool addTestResourcePool(@Validated @RequestBody TestResourcePoolRequest request) {
|
||||||
|
@ -44,6 +47,7 @@ public class TestResourcePoolController {
|
||||||
|
|
||||||
@GetMapping("/delete/{poolId}")
|
@GetMapping("/delete/{poolId}")
|
||||||
@CacheNode // 把监控节点缓存起来
|
@CacheNode // 把监控节点缓存起来
|
||||||
|
@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) {
|
||||||
|
@ -52,6 +56,7 @@ public class TestResourcePoolController {
|
||||||
|
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@CacheNode // 把监控节点缓存起来
|
@CacheNode // 把监控节点缓存起来
|
||||||
|
@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)", msClass = TestResourcePoolService.class)
|
@Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#request)", msClass = TestResourcePoolService.class)
|
||||||
public void updateTestResourcePool(@Validated @RequestBody TestResourcePoolRequest request) {
|
public void updateTestResourcePool(@Validated @RequestBody TestResourcePoolRequest request) {
|
||||||
|
@ -63,6 +68,7 @@ public class TestResourcePoolController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/page")
|
@PostMapping("/page")
|
||||||
|
@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);
|
||||||
|
@ -70,6 +76,7 @@ public class TestResourcePoolController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/detail/{poolId}")
|
@GetMapping("/detail/{poolId}")
|
||||||
|
@Operation(summary = "查看资源池详细")
|
||||||
@RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ)
|
@RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ)
|
||||||
public TestResourcePoolDTO getTestResourcePoolDetail(@PathVariable(value = "poolId") String testResourcePoolId) {
|
public TestResourcePoolDTO getTestResourcePoolDetail(@PathVariable(value = "poolId") String testResourcePoolId) {
|
||||||
return testResourcePoolService.getTestResourcePoolDetail(testResourcePoolId);
|
return testResourcePoolService.getTestResourcePoolDetail(testResourcePoolId);
|
||||||
|
|
|
@ -2,8 +2,6 @@ package io.metersphere.system.controller;
|
||||||
|
|
||||||
import base.BaseTest;
|
import base.BaseTest;
|
||||||
import io.metersphere.sdk.constants.SessionConstants;
|
import io.metersphere.sdk.constants.SessionConstants;
|
||||||
import io.metersphere.sdk.dto.QueryResourcePoolRequest;
|
|
||||||
import io.metersphere.sdk.util.JSON;
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.junit.jupiter.api.MethodOrderer;
|
import org.junit.jupiter.api.MethodOrderer;
|
||||||
import org.junit.jupiter.api.Order;
|
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 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.MockMvcResultHandlers.print;
|
||||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
|
|
||||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||||
|
|
||||||
@SpringBootTest
|
@SpringBootTest
|
||||||
@AutoConfigureMockMvc
|
@AutoConfigureMockMvc
|
||||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||||
public class SystemVersionControllerTest extends BaseTest {
|
public class SystemVersionControllerTests extends BaseTest {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private MockMvc mockMvc;
|
private MockMvc mockMvc;
|
|
@ -38,7 +38,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||||
@SpringBootTest
|
@SpringBootTest
|
||||||
@AutoConfigureMockMvc
|
@AutoConfigureMockMvc
|
||||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||||
class TestResourcePoolControllerTest extends BaseTest {
|
class TestResourcePoolControllerTests extends BaseTest {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private MockMvc mockMvc;
|
private MockMvc mockMvc;
|
Loading…
Reference in New Issue