【新增】模块exam,judgement并修改pom文件,新增rabbitmq依赖
This commit is contained in:
@@ -1,84 +1,14 @@
|
||||
package pc.exam.pp.module.exam.controller.admin;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import pc.exam.pp.framework.common.pojo.CommonResult;
|
||||
import pc.exam.pp.framework.common.pojo.PageResult;
|
||||
import pc.exam.pp.module.exam.controller.admin.vo.ExamPageReqVO;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.ExamDO;
|
||||
import pc.exam.pp.module.exam.service.ExamService;
|
||||
|
||||
import static pc.exam.pp.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 管理后台 - 考试信息
|
||||
* 管理后台 - 授权信息
|
||||
*
|
||||
* @author pengchen
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/exam")
|
||||
@RequestMapping("/exam/authorize")
|
||||
public class ExamController {
|
||||
|
||||
@Resource
|
||||
private ExamService examService;
|
||||
|
||||
/**
|
||||
* 创建考试
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 考试编号
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public CommonResult<Long> createExam(@Valid @RequestBody ExamDO createReqVO) {
|
||||
return success(examService.createExam(createReqVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新考试
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
* @return 成功状态
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public CommonResult<Boolean> updateExam(@Valid @RequestBody ExamDO updateReqVO) {
|
||||
examService.updateExam(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除考试
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 成功状态
|
||||
*/
|
||||
@DeleteMapping("/delete")
|
||||
public CommonResult<Boolean> deleteExam(@RequestParam("id") Long id) {
|
||||
examService.deleteExam(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得考试
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 考试
|
||||
*/
|
||||
@GetMapping("/get")
|
||||
public CommonResult<ExamDO> getExam(@RequestParam("id") Long id) {
|
||||
return success(examService.getExam(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得考试分页
|
||||
*
|
||||
* @param pageVO 分页查询
|
||||
* @return 考试分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public CommonResult<PageResult<ExamDO>> getExamPage(@Valid ExamPageReqVO pageVO) {
|
||||
return success(examService.getExamPage(pageVO));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user