|
@@ -1,12 +1,9 @@
|
|
package com.ruoyi.sim.controller;
|
|
package com.ruoyi.sim.controller;
|
|
|
|
|
|
-import java.util.List;
|
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
|
-
|
|
|
|
|
|
+import com.ruoyi.sim.domain.vo.RealExamCollectionVo;
|
|
import com.ruoyi.sim.service.impl.RealExamCollectionService;
|
|
import com.ruoyi.sim.service.impl.RealExamCollectionService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
@@ -21,8 +18,6 @@ import com.ruoyi.common.core.controller.BaseController;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
import com.ruoyi.sim.domain.RealExamCollection;
|
|
import com.ruoyi.sim.domain.RealExamCollection;
|
|
-import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
-import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 考试集合Controller
|
|
* 考试集合Controller
|
|
@@ -34,70 +29,79 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|
@RequestMapping("/sim/real-exam-collection")
|
|
@RequestMapping("/sim/real-exam-collection")
|
|
@Api("考试集合Controller")
|
|
@Api("考试集合Controller")
|
|
public class RealExamCollectionController extends BaseController {
|
|
public class RealExamCollectionController extends BaseController {
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
- private RealExamCollectionService realExamCollectionService;
|
|
|
|
|
|
+ private RealExamCollectionService service;
|
|
|
|
+
|
|
|
|
+ @GetMapping("/teacher/exam/list")
|
|
|
|
+ @ApiOperation("[教师][分页]查询考试集合列表")
|
|
|
|
+ public AjaxResult listExamByTeacher(RealExamCollection p) {
|
|
|
|
+ return service.listExamByTeacher(p);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @GetMapping("/teacher/exercise/list")
|
|
|
|
+ @ApiOperation("[教师][分页]查询考试集合列表")
|
|
|
|
+ public AjaxResult listExerciseByTeacher(RealExamCollection p) {
|
|
|
|
+ return service.listExerciseByTeacher(p);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @GetMapping(value = "/teacher/exam/{id}")
|
|
|
|
+ @ApiOperation("[教师]获取考试集合详细信息")
|
|
|
|
+ public AjaxResult getExamInfoByTeacher(@PathVariable("id") Long id) {
|
|
|
|
+ return service.getExamInfoByTeacher(id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @GetMapping(value = "/teacher/exercise/{id}")
|
|
|
|
+ @ApiOperation("[教师]获取练习集合详细信息")
|
|
|
|
+ public AjaxResult getExerciseInfoByTeacher(@PathVariable("id") Long id) {
|
|
|
|
+ return service.getExerciseInfoByTeacher(id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @PostMapping(value = "/teacher/exam/")
|
|
|
|
+ @ApiOperation("[教师]新增考试集合")
|
|
|
|
+ public AjaxResult addExam(@RequestBody RealExamCollectionVo vo) {
|
|
|
|
+ return service.addExam(vo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @PostMapping(value = "/teacher/exercise/")
|
|
|
|
+ @ApiOperation("[教师]新增练习集合")
|
|
|
|
+ public AjaxResult addExercise(@RequestBody RealExamCollectionVo vo) {
|
|
|
|
+ return service.addExercise(vo);
|
|
|
|
+ }
|
|
|
|
|
|
- // @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:list')")
|
|
|
|
- @GetMapping("/list")
|
|
|
|
- @ApiOperation("[老师]查询考试集合列表")
|
|
|
|
- public TableDataInfo list(RealExamCollection realExamCollection) {
|
|
|
|
- startPage();
|
|
|
|
- List<RealExamCollection> list = realExamCollectionService.selectRealExamCollectionList(realExamCollection);
|
|
|
|
- return getDataTable(list);
|
|
|
|
|
|
+ @PutMapping(value = "/teacher/exam/")
|
|
|
|
+ @ApiOperation("[教师]修改考试集合")
|
|
|
|
+ public AjaxResult editExam(@RequestBody RealExamCollectionVo vo) {
|
|
|
|
+ return service.editExam(vo);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 导出考试集合列表
|
|
|
|
- */
|
|
|
|
- @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:export')")
|
|
|
|
- @Log(title = "考试集合", businessType = BusinessType.EXPORT)
|
|
|
|
- @PostMapping("/export")
|
|
|
|
- public void export(HttpServletResponse response, RealExamCollection realExamCollection) {
|
|
|
|
- List<RealExamCollection> list = realExamCollectionService.selectRealExamCollectionList(realExamCollection);
|
|
|
|
- ExcelUtil<RealExamCollection> util = new ExcelUtil<RealExamCollection>(RealExamCollection.class);
|
|
|
|
- util.exportExcel(response, list, "考试集合数据");
|
|
|
|
|
|
+ @PutMapping(value = "/teacher/exercise/")
|
|
|
|
+ @ApiOperation("[教师]修改练习集合")
|
|
|
|
+ public AjaxResult edit(@RequestBody RealExamCollectionVo vo) {
|
|
|
|
+ return service.editExercise(vo);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 获取考试集合详细信息
|
|
|
|
- */
|
|
|
|
- // @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:query')")
|
|
|
|
- @GetMapping(value = "/{examCollectionId}")
|
|
|
|
- @ApiOperation("[老师]获取考试集合详细信息")
|
|
|
|
- public AjaxResult getInfo(@PathVariable("examCollectionId") Long examCollectionId) {
|
|
|
|
- return success(realExamCollectionService.selectRealExamCollectionByExamCollectionId(examCollectionId));
|
|
|
|
|
|
+ @DeleteMapping("/teacher/exam/{ids}")
|
|
|
|
+ @ApiOperation("[教师]删除多个考试集合")
|
|
|
|
+ public AjaxResult deleteExams(@PathVariable Long[] ids) {
|
|
|
|
+ return service.deleteExams(ids);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 新增考试集合
|
|
|
|
- */
|
|
|
|
- @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:add')")
|
|
|
|
- @Log(title = "考试集合", businessType = BusinessType.INSERT)
|
|
|
|
- @PostMapping
|
|
|
|
- @ApiOperation("[老师]新增考试集合")
|
|
|
|
- public AjaxResult add(@RequestBody RealExamCollection realExamCollection) {
|
|
|
|
- return toAjax(realExamCollectionService.insertRealExamCollection(realExamCollection));
|
|
|
|
|
|
+ @DeleteMapping("/teacher/exercise/{ids}")
|
|
|
|
+ @ApiOperation("[教师]删除多个考试集合")
|
|
|
|
+ public AjaxResult deleteExercises(@PathVariable Long[] ids) {
|
|
|
|
+ return service.deleteExercises(ids);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 修改考试集合
|
|
|
|
- */
|
|
|
|
- @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:edit')")
|
|
|
|
- @Log(title = "考试集合", businessType = BusinessType.UPDATE)
|
|
|
|
- @PutMapping
|
|
|
|
- @ApiOperation("[老师]修改考试集合")
|
|
|
|
- public AjaxResult edit(@RequestBody RealExamCollection realExamCollection) {
|
|
|
|
- return toAjax(realExamCollectionService.updateRealExamCollection(realExamCollection));
|
|
|
|
|
|
+ @PutMapping(value = "/teacher/exam/open/{id}")
|
|
|
|
+ @ApiOperation("[教师]打开考试集合")
|
|
|
|
+ public AjaxResult openExam(@PathVariable("id") Long id) {
|
|
|
|
+ return service.openExam(id);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 删除考试集合
|
|
|
|
- */
|
|
|
|
- @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:remove')")
|
|
|
|
- @Log(title = "考试集合", businessType = BusinessType.DELETE)
|
|
|
|
- @DeleteMapping("/{examCollectionIds}")
|
|
|
|
- @ApiOperation("[老师]删除考试集合")
|
|
|
|
- public AjaxResult remove(@PathVariable Long[] examCollectionIds) {
|
|
|
|
- return toAjax(realExamCollectionService.deleteRealExamCollectionByExamCollectionIds(examCollectionIds));
|
|
|
|
|
|
+ @PutMapping(value = "/teacher/exam/close/{id}")
|
|
|
|
+ @ApiOperation("[教师]关闭考试集合")
|
|
|
|
+ public AjaxResult closeExam(@PathVariable("id") Long id) {
|
|
|
|
+ return service.closeExam(id);
|
|
}
|
|
}
|
|
}
|
|
}
|