|
|
@@ -1,21 +1,18 @@
|
|
|
package com.ruoyi.web.controller.learn;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
+import com.ruoyi.enums.CardAction;
|
|
|
import com.ruoyi.enums.QuestionType;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
@@ -112,4 +109,15 @@ public class LearnQuestionsController extends BaseController
|
|
|
{
|
|
|
return toAjax(learnQuestionsService.deleteLearnQuestionsByIds(ids));
|
|
|
}
|
|
|
+
|
|
|
+ @Log(title = "修改题型", businessType = BusinessType.UPDATE)
|
|
|
+ @PostMapping("/changeType")
|
|
|
+ @ApiOperation("修改题型")
|
|
|
+ public AjaxResult updateQuestionType(@RequestBody JSONObject param)
|
|
|
+ {
|
|
|
+ QuestionType qt = QuestionType.of(param.getInteger("type"));
|
|
|
+ List<Long> ids = param.getList ("ids", Long.class);
|
|
|
+ learnQuestionsService.updateQuestionType(qt.name(), ids);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
}
|