|
@@ -4,6 +4,8 @@ import java.util.List;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import com.ruoyi.sim.service.impl.RealExamService;
|
|
import com.ruoyi.sim.service.impl.RealExamService;
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
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;
|
|
@@ -30,6 +32,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/sim/real-exam")
|
|
@RequestMapping("/sim/real-exam")
|
|
|
|
+@Api("考试Controller")
|
|
public class RealExamController extends BaseController {
|
|
public class RealExamController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private RealExamService realExamService;
|
|
private RealExamService realExamService;
|
|
@@ -37,20 +40,31 @@ public class RealExamController extends BaseController {
|
|
/**
|
|
/**
|
|
* 查询考试列表
|
|
* 查询考试列表
|
|
*/
|
|
*/
|
|
- @PreAuthorize("@ss.hasPermi('sim:real-exam:list')")
|
|
|
|
- @GetMapping("/list")
|
|
|
|
|
|
+ // @PreAuthorize("@ss.hasPermi('sim:real-exam:list')")
|
|
|
|
+ // @GetMapping("/list")
|
|
|
|
+ // @ApiOperation("查询考试列表")
|
|
public TableDataInfo list(RealExam realExam) {
|
|
public TableDataInfo list(RealExam realExam) {
|
|
startPage();
|
|
startPage();
|
|
List<RealExam> list = realExamService.selectRealExamList(realExam);
|
|
List<RealExam> list = realExamService.selectRealExamList(realExam);
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @GetMapping("/listByUserId/{userId}")
|
|
|
|
+ @ApiOperation("查询userId学生考试列表")
|
|
|
|
+ public TableDataInfo listByUserId(@PathVariable("userId") Long userId) {
|
|
|
|
+ // todo:
|
|
|
|
+ RealExam realExam = new RealExam();
|
|
|
|
+ startPage();
|
|
|
|
+ List<RealExam> list = realExamService.selectRealExamList(realExam);
|
|
|
|
+ return getDataTable(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 导出考试列表
|
|
* 导出考试列表
|
|
*/
|
|
*/
|
|
- @PreAuthorize("@ss.hasPermi('sim:real-exam:export')")
|
|
|
|
|
|
+ // @PreAuthorize("@ss.hasPermi('sim:real-exam:export')")
|
|
@Log(title = "考试", businessType = BusinessType.EXPORT)
|
|
@Log(title = "考试", businessType = BusinessType.EXPORT)
|
|
- @PostMapping("/export")
|
|
|
|
|
|
+ // @PostMapping("/export")
|
|
public void export(HttpServletResponse response, RealExam realExam) {
|
|
public void export(HttpServletResponse response, RealExam realExam) {
|
|
List<RealExam> list = realExamService.selectRealExamList(realExam);
|
|
List<RealExam> list = realExamService.selectRealExamList(realExam);
|
|
ExcelUtil<RealExam> util = new ExcelUtil<RealExam>(RealExam.class);
|
|
ExcelUtil<RealExam> util = new ExcelUtil<RealExam>(RealExam.class);
|
|
@@ -60,8 +74,9 @@ public class RealExamController extends BaseController {
|
|
/**
|
|
/**
|
|
* 获取考试详细信息
|
|
* 获取考试详细信息
|
|
*/
|
|
*/
|
|
- @PreAuthorize("@ss.hasPermi('sim:real-exam:query')")
|
|
|
|
|
|
+ // @PreAuthorize("@ss.hasPermi('sim:real-exam:query')")
|
|
@GetMapping(value = "/{examId}")
|
|
@GetMapping(value = "/{examId}")
|
|
|
|
+ @ApiOperation("获取考试详细信息")
|
|
public AjaxResult getInfo(@PathVariable("examId") Long examId) {
|
|
public AjaxResult getInfo(@PathVariable("examId") Long examId) {
|
|
return success(realExamService.selectRealExamByExamId(examId));
|
|
return success(realExamService.selectRealExamByExamId(examId));
|
|
}
|
|
}
|
|
@@ -69,7 +84,7 @@ public class RealExamController extends BaseController {
|
|
/**
|
|
/**
|
|
* 新增考试
|
|
* 新增考试
|
|
*/
|
|
*/
|
|
- @PreAuthorize("@ss.hasPermi('sim:real-exam:add')")
|
|
|
|
|
|
+ // @PreAuthorize("@ss.hasPermi('sim:real-exam:add')")
|
|
@Log(title = "考试", businessType = BusinessType.INSERT)
|
|
@Log(title = "考试", businessType = BusinessType.INSERT)
|
|
@PostMapping
|
|
@PostMapping
|
|
public AjaxResult add(@RequestBody RealExam realExam) {
|
|
public AjaxResult add(@RequestBody RealExam realExam) {
|
|
@@ -79,7 +94,7 @@ public class RealExamController extends BaseController {
|
|
/**
|
|
/**
|
|
* 修改考试
|
|
* 修改考试
|
|
*/
|
|
*/
|
|
- @PreAuthorize("@ss.hasPermi('sim:real-exam:edit')")
|
|
|
|
|
|
+ // @PreAuthorize("@ss.hasPermi('sim:real-exam:edit')")
|
|
@Log(title = "考试", businessType = BusinessType.UPDATE)
|
|
@Log(title = "考试", businessType = BusinessType.UPDATE)
|
|
@PutMapping
|
|
@PutMapping
|
|
public AjaxResult edit(@RequestBody RealExam realExam) {
|
|
public AjaxResult edit(@RequestBody RealExam realExam) {
|
|
@@ -89,9 +104,9 @@ public class RealExamController extends BaseController {
|
|
/**
|
|
/**
|
|
* 删除考试
|
|
* 删除考试
|
|
*/
|
|
*/
|
|
- @PreAuthorize("@ss.hasPermi('sim:real-exam:remove')")
|
|
|
|
|
|
+ // @PreAuthorize("@ss.hasPermi('sim:real-exam:remove')")
|
|
@Log(title = "考试", businessType = BusinessType.DELETE)
|
|
@Log(title = "考试", businessType = BusinessType.DELETE)
|
|
- @DeleteMapping("/{examIds}")
|
|
|
|
|
|
+ // @DeleteMapping("/{examIds}")
|
|
public AjaxResult remove(@PathVariable Long[] examIds) {
|
|
public AjaxResult remove(@PathVariable Long[] examIds) {
|
|
return toAjax(realExamService.deleteRealExamByExamIds(examIds));
|
|
return toAjax(realExamService.deleteRealExamByExamIds(examIds));
|
|
}
|
|
}
|