|
@@ -1,12 +1,61 @@
|
|
package cn.com.qmth.examcloud.service.core.api;
|
|
package cn.com.qmth.examcloud.service.core.api;
|
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.service.core.dao.ExamScoreRepo;
|
|
|
|
+import cn.com.qmth.examcloud.service.core.entity.ExamScore;
|
|
|
|
+import cn.com.qmth.examcloud.service.core.service.ExamScoreService;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.data.domain.PageRequest;
|
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Created by songyue on 17/1/13.
|
|
* Created by songyue on 17/1/13.
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
-@RequestMapping("${app.api.root}/examscore")
|
|
|
|
|
|
+@RequestMapping("${app.api.root}")
|
|
public class ExamScoreApi {
|
|
public class ExamScoreApi {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ ExamScoreRepo examScoreRepo;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ ExamScoreService examScoreService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ @ApiOperation(value="查询所有考试分数",notes = "分页")
|
|
|
|
+ @GetMapping("/examscore/all/{curPage}/{pageSize}")
|
|
|
|
+ public ResponseEntity getAllExam(@ModelAttribute ExamScore examCriteria, @PathVariable Integer curPage, @PathVariable Integer pageSize){
|
|
|
|
+ return examScoreService.getAllExamScore(examCriteria,new PageRequest(curPage - 1,pageSize));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value="查询所有考试分数",notes = "不分页")
|
|
|
|
+ @GetMapping("/examscore/all")
|
|
|
|
+ public ResponseEntity getAllExamScore(@ModelAttribute ExamScore examCriteria){
|
|
|
|
+ return examScoreService.getAllExamScore(examCriteria);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value="按ID查询考试分数",notes = "ID查询")
|
|
|
|
+ @GetMapping("/examscore/{id}")
|
|
|
|
+ public ResponseEntity<ExamScore> getExamScoreById(@PathVariable Long id){
|
|
|
|
+ return examScoreService.getExamScoreById(id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value="新增考试分数",notes = "新增")
|
|
|
|
+ @PostMapping("/examscore")
|
|
|
|
+ public ResponseEntity addExamScore(@ModelAttribute ExamScore examScore){
|
|
|
|
+ return examScoreService.saveExamScore(examScore);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value="更新考试分数",notes = "更新")
|
|
|
|
+ @PutMapping("/examscore")
|
|
|
|
+ public ResponseEntity updateExamScore(@ModelAttribute ExamScore examScore){
|
|
|
|
+ return examScoreService.saveExamScore(examScore);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value="按ID删除考试分数",notes = "删除")
|
|
|
|
+ @DeleteMapping("/examscore/{id}")
|
|
|
|
+ public ResponseEntity deleteExamScore(@PathVariable Long id){
|
|
|
|
+ return examScoreService.deleteExamScore(id);
|
|
|
|
+ }
|
|
}
|
|
}
|