diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectRobotController.java b/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectRobotController.java index fdd81ef090..215276af62 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectRobotController.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectRobotController.java @@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*; import java.util.List; -@Tag(name = "项目管理-项目与权限-消息管理-机器人") +@Tag(name = "项目管理-消息管理-机器人") @RestController @RequestMapping("/project/robot/") public class ProjectRobotController { @@ -27,15 +27,15 @@ public class ProjectRobotController { private ProjectRobotService projectRobotService; - @PostMapping("/list/{projectId}") - @Operation(summary = "项目管理-项目与权限-消息管理-获取机器人列表") + @GetMapping("/list/{projectId}") + @Operation(summary = "项目管理-消息管理-获取机器人列表") @RequiresPermissions(PermissionConstants.PROJECT_MESSAGE_READ) public List listResourcePools(@PathVariable(value = "projectId") String projectId) { return projectRobotService.getList(projectId); } @PostMapping("add") - @Operation(summary = "项目管理-项目与权限-消息管理-新增机器人") + @Operation(summary = "项目管理-消息管理-新增机器人") @RequiresPermissions(PermissionConstants.PROJECT_MESSAGE_READ_ADD) public void add(@Validated({Created.class}) @RequestBody ProjectRobotDTO projectRobotDTO) { ProjectRobot projectRobot = new ProjectRobot(); @@ -48,7 +48,7 @@ public class ProjectRobotController { } @PostMapping("update") - @Operation(summary = "项目管理-项目与权限-消息管理-更新机器人") + @Operation(summary = "项目管理-消息管理-更新机器人") @RequiresPermissions(PermissionConstants.PROJECT_MESSAGE_READ_UPDATE) public void update(@Validated({Updated.class}) @RequestBody ProjectRobotDTO projectRobotDTO) { ProjectRobot projectRobot = new ProjectRobot(); @@ -61,21 +61,21 @@ public class ProjectRobotController { } @GetMapping("get/{id}") - @Operation(summary = "项目管理-项目与权限-消息管理-获取机器人详情") + @Operation(summary = "项目管理-消息管理-获取机器人详情") @RequiresPermissions(PermissionConstants.PROJECT_MESSAGE_READ) public ProjectRobotDTO getDetail(@PathVariable(value = "id") String id) { return projectRobotService.getDetail(id); } @GetMapping("delete/{id}") - @Operation(summary = "项目管理-项目与权限-消息管理-删除机器人") + @Operation(summary = "项目管理-消息管理-删除机器人") @RequiresPermissions(PermissionConstants.PROJECT_MESSAGE_READ_DELETE) public void delete(@PathVariable(value = "id") String id) { projectRobotService.delete(id); } @GetMapping("enable/{id}") - @Operation(summary = "项目管理-项目与权限-消息管理-禁用机器人") + @Operation(summary = "项目管理-消息管理-启禁用机器人") @RequiresPermissions(PermissionConstants.PROJECT_MESSAGE_READ_UPDATE) public void enable(@PathVariable(value = "id") String id) { projectRobotService.enable(id, SessionUtils.getUserId(), System.currentTimeMillis()); diff --git a/backend/services/project-management/src/test/java/io/metersphere/project/controller/CleanupRobotResourceTests.java b/backend/services/project-management/src/test/java/io/metersphere/project/controller/CleanupRobotResourceTests.java index 539d4ab6d1..25fa7f3663 100644 --- a/backend/services/project-management/src/test/java/io/metersphere/project/controller/CleanupRobotResourceTests.java +++ b/backend/services/project-management/src/test/java/io/metersphere/project/controller/CleanupRobotResourceTests.java @@ -53,7 +53,7 @@ public class CleanupRobotResourceTests extends BaseTest { } private List getList() throws Exception { - MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.post(ROBOT_LIST + "test") + MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.get(ROBOT_LIST + "test") .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) diff --git a/backend/services/project-management/src/test/java/io/metersphere/project/controller/CreateRobotResourceTests.java b/backend/services/project-management/src/test/java/io/metersphere/project/controller/CreateRobotResourceTests.java index bd24309e3c..9dd75df825 100644 --- a/backend/services/project-management/src/test/java/io/metersphere/project/controller/CreateRobotResourceTests.java +++ b/backend/services/project-management/src/test/java/io/metersphere/project/controller/CreateRobotResourceTests.java @@ -43,7 +43,7 @@ public class CreateRobotResourceTests extends BaseTest { } private List getList() throws Exception { - MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.post(ROBOT_LIST + "test") + MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.get(ROBOT_LIST + "test") .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) diff --git a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectRobotControllerTests.java b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectRobotControllerTests.java index f2070f9d02..6386d4a498 100644 --- a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectRobotControllerTests.java +++ b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectRobotControllerTests.java @@ -363,7 +363,7 @@ public class ProjectRobotControllerTests extends BaseTest { } private List getList(String projectId) throws Exception { - MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.post(ROBOT_LIST + projectId) + MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.get(ROBOT_LIST + projectId) .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON))