Bladeren bron

修改题目接口

小么熊🐻 4 jaren geleden
bovenliggende
commit
96438677a1

+ 2 - 0
zzjs-admin/src/main/java/com/miaxis/app/controller/question/QuestionCollectionController.java

@@ -42,6 +42,8 @@ public class QuestionCollectionController extends BaseController{
     @PostMapping
     @ApiOperation("新增题目收藏")
     public Response<Integer> add(@RequestBody QuestionCollection questionCollection){
+        UserInfo student = SecurityUtils.getLoginUser().getStudent();
+        questionCollection.setUserId(student.getId());
         return toResponse(questionCollectionService.save(questionCollection) ? 1 : 0);
     }
 

+ 4 - 40
zzjs-admin/src/main/java/com/miaxis/app/controller/question/QuestionErrorController.java

@@ -31,24 +31,6 @@ public class QuestionErrorController extends BaseController{
     @Autowired
     private IQuestionErrorService questionErrorService;
 
-    /**
-     * 查询错题列表
-     */
-//    @PreAuthorize("@ss.hasPermi('question:error: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("查询错题列表")
@@ -64,18 +46,7 @@ public class QuestionErrorController extends BaseController{
         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));
-//    }
+
 
     /**
      * 新增错题
@@ -85,19 +56,12 @@ public class QuestionErrorController extends BaseController{
     @PostMapping
     @ApiOperation("新增错题")
     public Response<Integer> add(@RequestBody QuestionError questionError){
+        UserInfo student = SecurityUtils.getLoginUser().getStudent();
+        questionError.setUserId(student.getId());
         return toResponse(questionErrorService.save(questionError) ? 1 : 0);
     }
 
-    /**
-     * 修改错题
-     */
-    //@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);
-//    }
+
 
     /**
      * 删除错题

+ 2 - 62
zzjs-admin/src/main/java/com/miaxis/app/controller/question/QuestionInfoController.java

@@ -62,75 +62,15 @@ public class QuestionInfoController extends BaseController{
 
     @GetMapping("/getRandQuestionInfoList")
     @ApiOperation("查询随机题库列表")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
-            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
-    })
     public ResponsePageInfo<QuestionInfo> getRandQuestionInfoList(@ModelAttribute QuestionInfoRandDto questionInfoRandDto){
-        startPage();
+//        startPage();
         List<QuestionInfo> list = questionInfoService.getRandQuestionInfoList(questionInfoRandDto);
         return toResponsePageInfo(list);
     }
 
-    /**
-     * 导出题库列表
-     */
-//    @PreAuthorize("@ss.hasPermi('question:info:export')")
-//    @Log(title = "题库", businessType = BusinessTypeEnum.EXPORT)
-//    @GetMapping("/export")
-//    @ApiOperation("导出题库列表Excel")
-//    public Response<String> export(@ModelAttribute QuestionInfo questionInfo){
-//        List<QuestionInfo> list = questionInfoService.selectQuestionInfoList(questionInfo);
-//        ExcelUtil<QuestionInfo> util = new ExcelUtil<QuestionInfo>(QuestionInfo.class);
-//        return util.exportExcel(list, "info");
-//    }
 
-    /**
-     * 获取题库详细信息
-     */
-//    @PreAuthorize("@ss.hasPermi('question:info:query')")
-//    @GetMapping(value = "/{id}")
-//    @ApiOperation("获取题库详细信息")
-//    public Response<QuestionInfo> getInfo(
-//            @ApiParam(name = "id", value = "题库参数", required = true)
-//            @PathVariable("id") Long id
-//    ){
-//        return Response.success(questionInfoService.getById(id));
-//    }
 
-    /**
-     * 新增题库
-     */
-//    @PreAuthorize("@ss.hasPermi('question:info:add')")
-//    @Log(title = "题库", businessType = BusinessTypeEnum.INSERT)
-//    @PostMapping
-//    @ApiOperation("新增题库")
-//    public Response<Integer> add(@RequestBody QuestionInfo questionInfo){
-//        return toResponse(questionInfoService.save(questionInfo) ? 1 : 0);
-//    }
 
-    /**
-     * 修改题库
-     */
-//    @PreAuthorize("@ss.hasPermi('question:info:edit')")
-//    @Log(title = "题库", businessType = BusinessTypeEnum.UPDATE)
-//    @PutMapping
-//    @ApiOperation("修改题库")
-//    public Response<Integer> edit(@RequestBody QuestionInfo questionInfo){
-//        return toResponse(questionInfoService.updateById(questionInfo) ? 1 : 0);
-//    }
 
-    /**
-     * 删除题库
-     */
-//    @PreAuthorize("@ss.hasPermi('question:info:remove')")
-//    @Log(title = "题库", businessType = BusinessTypeEnum.DELETE)
-//	@DeleteMapping("/{ids}")
-//    @ApiOperation("删除题库")
-//    public  Response<Integer> remove(
-//            @ApiParam(name = "ids", value = "题库ids参数", required = true)
-//            @PathVariable Long[] ids
-//    ){
-//        return toResponse(questionInfoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
-//    }
+
 }

+ 2 - 2
zzjs-service/src/main/java/com/miaxis/question/domain/QuestionError.java

@@ -22,9 +22,9 @@ import org.apache.commons.lang3.builder.ToStringStyle;
 public class QuestionError extends BaseBusinessEntity{
     private static final long serialVersionUID = 1L;
 
-    /** id */
+    /** $column.columnComment */
     @TableId(value = "id")
-    @ApiModelProperty(value = "id")
+    @ApiModelProperty(value = "$column.columnComment")
     private Long id;
 
     /** 用户id */

+ 5 - 0
zzjs-service/src/main/java/com/miaxis/question/dto/QuestionInfoDto.java

@@ -53,5 +53,10 @@ public class QuestionInfoDto extends BaseBusinessEntity{
     private Long showOptionType;
 
 
+    /**
+     * 排序
+     */
+    @ApiModelProperty(value = "排序")
+    private String orderByClause;
 
 }

+ 3 - 0
zzjs-service/src/main/resources/mapper/question/QuestionInfoMapper.xml

@@ -87,6 +87,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="kemu != null "> and kemu = #{kemu}</if>
             <if test="showOptionType != null "> and show_option_type = #{showOptionType}</if>
         </where>
+        <if test="orderByClause != null">
+            order by id ${orderByClause}
+        </if>
     </select>