|
@@ -3,6 +3,7 @@ package cn.seecoder.seecoderportalserver.web.rest;
|
|
|
import cn.seecoder.seecoderportalserver.service.Impl.EvalService;
|
|
import cn.seecoder.seecoderportalserver.service.Impl.EvalService;
|
|
|
import cn.seecoder.seecoderportalserver.utility.OkResponse;
|
|
import cn.seecoder.seecoderportalserver.utility.OkResponse;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
@@ -19,4 +20,13 @@ public class EvalController {
|
|
|
public OkResponse<JSONObject> getAllExams(@RequestParam(defaultValue = "100") int pageSize, @RequestParam(defaultValue = "1") int pageNum) {
|
|
public OkResponse<JSONObject> getAllExams(@RequestParam(defaultValue = "100") int pageSize, @RequestParam(defaultValue = "1") int pageNum) {
|
|
|
return OkResponse.of((JSONObject) evalService.getAllExams(pageSize, pageNum).get("result"));
|
|
return OkResponse.of((JSONObject) evalService.getAllExams(pageSize, pageNum).get("result"));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/exams/student")
|
|
|
|
|
+ public OkResponse<JSONObject> getStudentExams(@RequestParam(defaultValue = "100") int pageSize,
|
|
|
|
|
+ @RequestParam(defaultValue = "1") int pageNum,
|
|
|
|
|
+ @ApiParam(name = "state", value = "0 所有, 1 未开始,2 进行中,3 已结束")
|
|
|
|
|
+ @RequestParam(value = "state") int state
|
|
|
|
|
+ ){
|
|
|
|
|
+ return OkResponse.of((JSONObject) evalService.getStudentExams(pageSize, pageNum, state).get("result"));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|