|
@@ -1,76 +0,0 @@
|
|
|
-package cn.com.qmth.examcloud.core.examwork.api.controller;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.data.domain.Page;
|
|
|
-import org.springframework.data.domain.PageRequest;
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
-import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgTimeRepo;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgTime;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.service.impl.ExamOrgTimeService;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-
|
|
|
-/**
|
|
|
- * 考试服务API Created by songyue on 17/1/13.
|
|
|
- */
|
|
|
-@Transactional
|
|
|
-@RestController
|
|
|
-@RequestMapping("${$rmp.ctr.examwork}/examOrgTime")
|
|
|
-public class ExamOrgTimeController {
|
|
|
-
|
|
|
- @Autowired
|
|
|
- ExamOrgTimeRepo examOrgTimeRepo;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- ExamOrgTimeService examOrgTimeService;
|
|
|
-
|
|
|
- @ApiOperation(value = "查询学习中心考试时间", notes = "分页")
|
|
|
- @GetMapping("{curPage}/{pageSize}")
|
|
|
- public ResponseEntity findByExamId(@ModelAttribute ExamOrgTime examOrgTime,
|
|
|
- @PathVariable Integer curPage, @PathVariable Integer pageSize) {
|
|
|
- PageRequest pageRequest = new PageRequest(curPage, pageSize);
|
|
|
- Page<ExamOrgTime> orgTimePage = examOrgTimeService.getAllOrgTime(examOrgTime, pageRequest);
|
|
|
- return new ResponseEntity(orgTimePage, HttpStatus.OK);
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "查询学习中心考试时间", notes = "不分页")
|
|
|
- @GetMapping("{examId}")
|
|
|
- public ResponseEntity findByExamId(@PathVariable Long examId) {
|
|
|
- List<ExamOrgTime> orgTimePage = examOrgTimeRepo.findByExamId(examId);
|
|
|
- return new ResponseEntity(orgTimePage, HttpStatus.OK);
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "按ID查询学习中心考试时间", notes = "ID查询")
|
|
|
- @GetMapping("{id}")
|
|
|
- public ResponseEntity findById(@PathVariable Long id) {
|
|
|
- return new ResponseEntity(examOrgTimeRepo.findOne(id), HttpStatus.OK);
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "新增学习中心考试时间", notes = "新增")
|
|
|
- @PostMapping()
|
|
|
- public ExamOrgTime add(@RequestBody ExamOrgTime examOrgTime) {
|
|
|
- ExamOrgTime saved = examOrgTimeRepo.save(examOrgTime);
|
|
|
-
|
|
|
- return saved;
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "更新学习中心考试时间", notes = "更新")
|
|
|
- @PutMapping()
|
|
|
- public ExamOrgTime update(@RequestBody ExamOrgTime examOrgTime) {
|
|
|
-
|
|
|
- ExamOrgTime saved = examOrgTimeRepo.save(examOrgTime);
|
|
|
- return saved;
|
|
|
- }
|
|
|
-}
|