diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/PaperController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/PaperController.java index 532babc..0014a3e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/PaperController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/PaperController.java @@ -3,17 +3,23 @@ package com.ruoyi.web.controller.exam; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.exam.dto.ExamDTO; import com.ruoyi.system.domain.paper.dto.request.PaperAnswerDTO; +import com.ruoyi.system.domain.paper.dto.request.PaperListReqDTO; import com.ruoyi.system.domain.paper.dto.request.PaperQuQueryDTO; +import com.ruoyi.system.domain.paper.dto.response.PaperListRespDTO; import com.ruoyi.web.controller.manager.PaperManager; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.List; /** * packageName com.ruoyi.web.controller.examination @@ -34,6 +40,17 @@ public class PaperController extends BaseController { private PaperManager paperManager; + @ApiOperation("在线考试") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(PaperListReqDTO paperListReqDTO) { + startPage(); + List list = paperManager.paging(paperListReqDTO); + return getDataTable(list); + } + + + @ApiOperation("创建试卷") @Log(title = "创建试卷", businessType = BusinessType.INSERT) @GetMapping("/create/{examId}") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/PaperManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/PaperManager.java index 07f0281..16ec36a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/PaperManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/PaperManager.java @@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.quartz.service.ISysJobService; import com.ruoyi.system.domain.exam.ElExam; +import com.ruoyi.system.domain.exam.dto.ExamDTO; import com.ruoyi.system.domain.exam.dto.ExamRepoDTO; import com.ruoyi.system.domain.exam.dto.ext.ExamRepoExtDTO; import com.ruoyi.system.domain.exam.enums.ExamState; @@ -18,7 +19,9 @@ import com.ruoyi.system.domain.paper.dto.PaperQuDTO; import com.ruoyi.system.domain.paper.dto.ext.PaperQuAnswerExtDTO; import com.ruoyi.system.domain.paper.dto.ext.PaperQuDetailDTO; import com.ruoyi.system.domain.paper.dto.request.PaperAnswerDTO; +import com.ruoyi.system.domain.paper.dto.request.PaperListReqDTO; import com.ruoyi.system.domain.paper.dto.response.ExamDetailRespDTO; +import com.ruoyi.system.domain.paper.dto.response.PaperListRespDTO; import com.ruoyi.system.domain.paper.enums.PaperState; import com.ruoyi.system.domain.qu.ElQu; import com.ruoyi.system.domain.qu.ElQuAnswer; @@ -94,6 +97,18 @@ public class PaperManager { }); + + /** + * 查询 + * + * @param paperListReqDTO + * @return java.util.List + */ + public List paging(PaperListReqDTO paperListReqDTO) { + return paperService.paging(paperListReqDTO); + } + + /** * * 创建试卷