|
|
@@ -7,9 +7,9 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import cn.seecoder.web.model.vo.Response;
|
|
|
-import cn.seecoder.web.model.vo.project.TestCaseVO;
|
|
|
-import cn.seecoder.web.model.vo.project.TestStepVO;
|
|
|
-import cn.seecoder.web.service.project.TestCaseService;
|
|
|
+import cn.seecoder.web.model.vo.project.FuncTestCaseVO;
|
|
|
+import cn.seecoder.web.model.vo.project.FuncTestStepVO;
|
|
|
+import cn.seecoder.web.service.project.FuncTestService;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -21,27 +21,27 @@ import java.util.List;
|
|
|
@Api(tags = "测试用例相关 API")
|
|
|
@RestController
|
|
|
@RequestMapping("/test_cases")
|
|
|
-public class TestCaseController {
|
|
|
+public class FuncTestController {
|
|
|
|
|
|
- private final TestCaseService testCaseService;
|
|
|
+ private final FuncTestService funcTestService;
|
|
|
|
|
|
@Autowired
|
|
|
- public TestCaseController(TestCaseService testCaseService) {
|
|
|
- this.testCaseService = testCaseService;
|
|
|
+ public FuncTestController(FuncTestService funcTestService) {
|
|
|
+ this.funcTestService = funcTestService;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取项目的测试用例列表", httpMethod = "GET")
|
|
|
@ApiImplicitParam(name = "projectId",dataType ="int", paramType = "query")
|
|
|
@GetMapping
|
|
|
- public Response<List<TestCaseVO>> getTestCases(@RequestParam("projectId") Integer projectId){
|
|
|
- return Response.buildSuccess(testCaseService.getTestCases(projectId));
|
|
|
+ public Response<List<FuncTestCaseVO>> getTestCases(@RequestParam("projectId") Integer projectId){
|
|
|
+ return Response.buildSuccess(funcTestService.getTestCases(projectId));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/steps")
|
|
|
@ApiOperation(value = "获取测试用例的步骤列表", httpMethod = "GET")
|
|
|
@ApiImplicitParam(name = "testCaseId",dataType ="int", paramType = "query")
|
|
|
- public Response<List<TestStepVO>> getTestSteps(@RequestParam("testCaseId")Integer testCaseId){
|
|
|
- return Response.buildSuccess(testCaseService.getTestSteps(testCaseId));
|
|
|
+ public Response<List<FuncTestStepVO>> getTestSteps(@RequestParam("testCaseId")Integer testCaseId){
|
|
|
+ return Response.buildSuccess(funcTestService.getTestSteps(testCaseId));
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -53,7 +53,7 @@ public class TestCaseController {
|
|
|
@ApiImplicitParam(name = "title",dataType ="string", paramType = "query")
|
|
|
})
|
|
|
public Response createTestCase(@RequestParam("projectId") Integer projectId,@RequestParam("title") String title){
|
|
|
- testCaseService.createTestCase(projectId, title);
|
|
|
+ funcTestService.createTestCase(projectId, title);
|
|
|
return Response.buildSuccess();
|
|
|
}
|
|
|
|
|
|
@@ -64,18 +64,27 @@ public class TestCaseController {
|
|
|
})
|
|
|
@PutMapping
|
|
|
public Response updateTestCaseTitle(@RequestParam("testCaseId") Integer testCaseId,@RequestParam("title") String title){
|
|
|
- testCaseService.updateTestCaseTitle(testCaseId, title);
|
|
|
+ funcTestService.updateTestCaseTitle(testCaseId, title);
|
|
|
return Response.buildSuccess();
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "更新测试用例测试状态", httpMethod = "PUT")
|
|
|
+ @ApiOperation(value = "完成测试用例测试", httpMethod = "PUT")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "testCaseId",dataType ="int", paramType = "query"),
|
|
|
- @ApiImplicitParam(name = "pass",dataType ="boolean", paramType = "query")
|
|
|
})
|
|
|
- @PutMapping("/pass")
|
|
|
- public Response updateTestCaseState(@RequestParam("testCaseId") Integer testCaseId,@RequestParam("pass") Boolean pass){
|
|
|
- testCaseService.updateTestCaseState(testCaseId, pass);
|
|
|
+ @PutMapping("/finish")
|
|
|
+ public Response finish(@RequestParam("testCaseId") Integer testCaseId){
|
|
|
+ funcTestService.finish(testCaseId);
|
|
|
+ return Response.buildSuccess();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "重新开放测试用例测试", httpMethod = "PUT")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "testCaseId",dataType ="int", paramType = "query"),
|
|
|
+ })
|
|
|
+ @PutMapping("/reopen")
|
|
|
+ public Response reopen(@RequestParam("testCaseId") Integer testCaseId){
|
|
|
+ funcTestService.reopen(testCaseId);
|
|
|
return Response.buildSuccess();
|
|
|
}
|
|
|
|
|
|
@@ -83,7 +92,7 @@ public class TestCaseController {
|
|
|
@ApiImplicitParam(name = "testCaseId",dataType ="int", paramType = "query")
|
|
|
@DeleteMapping
|
|
|
public Response deleteTestCase(@RequestParam("testCaseId") Integer testCaseId){
|
|
|
- testCaseService.deleteTestCase(testCaseId);
|
|
|
+ funcTestService.deleteTestCase(testCaseId);
|
|
|
return Response.buildSuccess();
|
|
|
}
|
|
|
|
|
|
@@ -91,7 +100,7 @@ public class TestCaseController {
|
|
|
@ApiImplicitParam(name = "testCaseId",dataType ="int", paramType = "query")
|
|
|
@PostMapping("/steps")
|
|
|
public Response createEmptyTestStep(@RequestParam("testCaseId") Integer testCaseId){
|
|
|
- testCaseService.createEmptyTestStep(testCaseId);
|
|
|
+ funcTestService.createEmptyTestStep(testCaseId);
|
|
|
return Response.buildSuccess();
|
|
|
}
|
|
|
|
|
|
@@ -103,7 +112,7 @@ public class TestCaseController {
|
|
|
})
|
|
|
@PutMapping("/steps")
|
|
|
public Response updateTestStepDescription(@RequestParam("testStepId") Integer testStepId, @RequestParam("description") String description){
|
|
|
- testCaseService.updateTestStepDescription(testStepId, description);
|
|
|
+ funcTestService.updateTestStepDescription(testStepId, description);
|
|
|
return Response.buildSuccess();
|
|
|
}
|
|
|
|
|
|
@@ -111,7 +120,14 @@ public class TestCaseController {
|
|
|
@ApiImplicitParam(name = "testStepId",dataType ="int", paramType = "query")
|
|
|
@DeleteMapping("/steps")
|
|
|
public Response deleteTestStep(@RequestParam("testStepId") Integer testStepId){
|
|
|
- testCaseService.deleteTestStep(testStepId);
|
|
|
+ funcTestService.deleteTestStep(testStepId);
|
|
|
return Response.buildSuccess();
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取当前部署的所有相关测试用例历史记录信息", httpMethod = "GET")
|
|
|
+ @ApiImplicitParam(name = "projectId",dataType ="int", paramType = "query")
|
|
|
+ @GetMapping("/record/latest")
|
|
|
+ public Response getLatestRecord(@RequestParam("projectId") Integer projectId){
|
|
|
+ return Response.buildSuccess(funcTestService.getLatestRecord(projectId));
|
|
|
+ }
|
|
|
}
|