|
|
@@ -6,6 +6,8 @@ import cn.seecoder.ojserver.service.ProblemService;
|
|
|
import cn.seecoder.ojserver.web.Response;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
@RestController
|
|
|
@RequestMapping(path = "/api/problem")
|
|
|
public class ProblemController {
|
|
|
@@ -20,6 +22,11 @@ public class ProblemController {
|
|
|
return Response.buildSuccess(this.problemService.create(problemVO));
|
|
|
}
|
|
|
|
|
|
+ @DeleteMapping("")
|
|
|
+ public Response delete(@RequestParam int problemId){
|
|
|
+ return Response.buildSuccess(this.problemService.delete(problemId));
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping("")
|
|
|
public Response getAll(){
|
|
|
return Response.buildSuccess(this.problemService.getAllProblemsBasic());
|
|
|
@@ -31,11 +38,33 @@ public class ProblemController {
|
|
|
return Response.buildSuccess(this.problemService.getProblemById(problemId));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @GetMapping("/manage")
|
|
|
+ public Response getProblemManageList(){
|
|
|
+ return Response.buildSuccess(this.problemService.getProblemDetailList());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/manage/{problemId:\\d+}")
|
|
|
+ public Response getProblemManage(@PathVariable int problemId){
|
|
|
+ return Response.buildSuccess(this.problemService.getProblemManageById(problemId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/testcase")
|
|
|
+ public Response getTestCases(@RequestParam Integer problemId){
|
|
|
+ return Response.buildSuccess(this.problemService.getTestCasesByProblemId(problemId));
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/testcase")
|
|
|
public Response addTestCase(@RequestBody TestCaseVO testCaseVO){
|
|
|
return Response.buildSuccess(this.problemService.addTestCase(testCaseVO));
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/batchTestcase")
|
|
|
+ public Response batchAddTestCase(@RequestBody List<TestCaseVO> testCaseVOList){
|
|
|
+ return Response.buildSuccess(this.problemService.addTestCaseList(testCaseVOList));
|
|
|
+ }
|
|
|
+
|
|
|
@DeleteMapping("/testcase")
|
|
|
public Response deleteTestCase(@RequestParam Integer testCaseId){
|
|
|
return Response.buildSuccess(this.problemService.deleteTestCase(testCaseId));
|