|
|
@@ -2,8 +2,8 @@ package cn.seecoder.seecoderportalserver.web.rest;
|
|
|
|
|
|
import cn.seecoder.seecoderportalserver.service.Impl.EvalService;
|
|
|
import cn.seecoder.seecoderportalserver.utility.OkResponse;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
@@ -16,16 +16,21 @@ public class EvalController {
|
|
|
|
|
|
public EvalController(EvalService evalService) {this.evalService = evalService;}
|
|
|
|
|
|
- @GetMapping("/exams")
|
|
|
+ @GetMapping("/exam/all")
|
|
|
public OkResponse<JSONObject> getAllExams(@RequestParam(defaultValue = "100") int pageSize, @RequestParam(defaultValue = "1") int pageNum) {
|
|
|
return OkResponse.of((JSONObject) evalService.getAllExams(pageSize, pageNum).get("result"));
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/exams/student")
|
|
|
+ @GetMapping("/exam/student")
|
|
|
public OkResponse<JSONObject> getStudentExams(@RequestParam(defaultValue = "100") int pageSize,
|
|
|
@RequestParam(defaultValue = "1") int pageNum,
|
|
|
@RequestParam(value = "state") int state
|
|
|
) {
|
|
|
return OkResponse.of((JSONObject) evalService.getStudentExams(pageSize, pageNum, state).get("result"));
|
|
|
}
|
|
|
+
|
|
|
+ @GetMapping("/exam/recommend")
|
|
|
+ public OkResponse<JSONArray> getExampleExams(){
|
|
|
+ return OkResponse.of((JSONArray) evalService.getExampleExams().get("result"));
|
|
|
+ }
|
|
|
}
|