|
@@ -4,15 +4,15 @@ import com.miaxis.common.annotation.Log;
|
|
|
import com.miaxis.common.constant.Constants;
|
|
|
import com.miaxis.common.core.controller.BaseController;
|
|
|
import com.miaxis.common.core.domain.Response;
|
|
|
+import com.miaxis.common.core.domain.entity.UserInfo;
|
|
|
import com.miaxis.common.core.page.ResponsePageInfo;
|
|
|
import com.miaxis.common.enums.BusinessTypeEnum;
|
|
|
-import com.miaxis.common.utils.poi.ExcelUtil;
|
|
|
-
|
|
|
+import com.miaxis.common.utils.SecurityUtils;
|
|
|
import com.miaxis.question.domain.QuestionError;
|
|
|
+import com.miaxis.question.dto.QuestionErrorDto;
|
|
|
import com.miaxis.question.service.IQuestionErrorService;
|
|
|
import io.swagger.annotations.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.Arrays;
|
|
@@ -35,31 +35,47 @@ public class QuestionErrorController extends BaseController{
|
|
|
* 查询错题列表
|
|
|
*/
|
|
|
// @PreAuthorize("@ss.hasPermi('question:error:list')")
|
|
|
- @GetMapping("/list")
|
|
|
+// @GetMapping("/list")
|
|
|
+// @ApiOperation("查询错题列表")
|
|
|
+// @ApiImplicitParams({
|
|
|
+// @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
|
|
|
+// @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
|
|
|
+// })
|
|
|
+// public ResponsePageInfo<QuestionError> list(@ModelAttribute QuestionError questionError){
|
|
|
+// startPage();
|
|
|
+// UserInfo student = SecurityUtils.getLoginUser().getStudent();
|
|
|
+// student.getId();
|
|
|
+// List<QuestionError> list = questionErrorService.selectQuestionErrorList(questionError);
|
|
|
+// return toResponsePageInfo(list);
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/getQuestionErrorList")
|
|
|
@ApiOperation("查询错题列表")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
|
|
|
@ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
|
|
|
})
|
|
|
- public ResponsePageInfo<QuestionError> list(@ModelAttribute QuestionError questionError){
|
|
|
+ public ResponsePageInfo<QuestionError> getQuestionErrorList(@ModelAttribute QuestionErrorDto questionErrorDto){
|
|
|
startPage();
|
|
|
- List<QuestionError> list = questionErrorService.selectQuestionErrorList(questionError);
|
|
|
+ UserInfo student = SecurityUtils.getLoginUser().getStudent();
|
|
|
+ questionErrorDto.setUserId(student.getId());
|
|
|
+ List<QuestionError> list = questionErrorService.getQuestionErrorList(questionErrorDto);
|
|
|
return toResponsePageInfo(list);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 获取错题详细信息
|
|
|
*/
|
|
|
//@PreAuthorize("@ss.hasPermi('question:error:query')")
|
|
|
- @GetMapping(value = "/{id}")
|
|
|
- @ApiOperation("获取错题详细信息")
|
|
|
- public Response<QuestionError> getInfo(
|
|
|
- @ApiParam(name = "id", value = "错题参数", required = true)
|
|
|
- @PathVariable("id") Long id
|
|
|
- ){
|
|
|
- return Response.success(questionErrorService.getById(id));
|
|
|
- }
|
|
|
+// @GetMapping(value = "/{id}")
|
|
|
+// @ApiOperation("获取错题详细信息")
|
|
|
+// public Response<QuestionError> getInfo(
|
|
|
+// @ApiParam(name = "id", value = "错题参数", required = true)
|
|
|
+// @PathVariable("id") Long id
|
|
|
+// ){
|
|
|
+// return Response.success(questionErrorService.getById(id));
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 新增错题
|
|
@@ -76,12 +92,12 @@ public class QuestionErrorController extends BaseController{
|
|
|
* 修改错题
|
|
|
*/
|
|
|
//@PreAuthorize("@ss.hasPermi('question:error:edit')")
|
|
|
- @Log(title = "错题", businessType = BusinessTypeEnum.UPDATE)
|
|
|
- @PutMapping
|
|
|
- @ApiOperation("修改错题")
|
|
|
- public Response<Integer> edit(@RequestBody QuestionError questionError){
|
|
|
- return toResponse(questionErrorService.updateById(questionError) ? 1 : 0);
|
|
|
- }
|
|
|
+// @Log(title = "错题", businessType = BusinessTypeEnum.UPDATE)
|
|
|
+// @PutMapping
|
|
|
+// @ApiOperation("修改错题")
|
|
|
+// public Response<Integer> edit(@RequestBody QuestionError questionError){
|
|
|
+// return toResponse(questionErrorService.updateById(questionError) ? 1 : 0);
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 删除错题
|