|
|
@@ -28,21 +28,21 @@ public class EvaluationController {
|
|
|
* @param studentId 学生ID
|
|
|
* @return
|
|
|
*/
|
|
|
- @PostMapping("/overall")
|
|
|
- public CompletableFuture<MyResponse> rewrite(
|
|
|
- @RequestParam Long assignmentId,
|
|
|
- @RequestParam Long studentId
|
|
|
- ) throws ExecutionException, InterruptedException {
|
|
|
- return aiEvaluationService.evaluationAsync(assignmentId, studentId)
|
|
|
- .thenApply(result -> MyResponse.success(result))
|
|
|
- .exceptionally(ex -> MyResponse.error(500, "AI请求失败:" + ex.getMessage()));
|
|
|
- } //真正的异步,之前的假异步
|
|
|
- // public MyResponse rewrite(
|
|
|
- // @RequestParam Long assignmentId,
|
|
|
- // @RequestParam Long studentId
|
|
|
- // ) throws ExecutionException, InterruptedException {
|
|
|
- // return MyResponse.success(aiEvaluationService.evaluationAsync(assignmentId, studentId).get());
|
|
|
- // }
|
|
|
+ @PostMapping("/overall")
|
|
|
+// public CompletableFuture<MyResponse> rewrite(
|
|
|
+// @RequestParam Long assignmentId,
|
|
|
+// @RequestParam Long studentId
|
|
|
+// ) throws ExecutionException, InterruptedException {
|
|
|
+// return aiEvaluationService.evaluationAsync(assignmentId, studentId)
|
|
|
+// .thenApply(result -> MyResponse.success(result))
|
|
|
+// .exceptionally(ex -> MyResponse.error(500, "AI请求失败:" + ex.getMessage()));
|
|
|
+// } //真正的异步,之前的假异步
|
|
|
+ public MyResponse rewrite(
|
|
|
+ @RequestParam Long assignmentId,
|
|
|
+ @RequestParam Long studentId
|
|
|
+ ) throws ExecutionException, InterruptedException {
|
|
|
+ return MyResponse.success(aiEvaluationService.evaluationAsync(assignmentId, studentId).get());
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 对作文进行逐句批改
|