无关风月
2024-07-03 1ab3022a08c32087cbc131fd00e25affacbb5eff
ruoyi-service/ruoyi-management/src/main/java/com/ruoyi/management/controller/TStudyController.java
@@ -16,6 +16,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -30,7 +31,7 @@
 * @since 2024-04-26
 */
@Controller
@RequestMapping("/management/tStudy")
@RequestMapping("/tStudy")
public class TStudyController {
    @Autowired
    private StudyClient studyClient;
@@ -43,9 +44,9 @@
        return AjaxResult.success(data);
    }
    @ApiOperation(value = "选择故事列表查询", tags = {"后台-学习"})
    @PostMapping(value = "/storyist1")
    @PostMapping(value = "/storyList1")
    @ResponseBody
    public AjaxResult<PageInfo<TStory>> storyist(ChoiceStory dto) {
    public AjaxResult<PageInfo<TStory>> storyList(ChoiceStory dto) {
        R<PageInfo<TStory>> pageInfoR = studyClient.storyList(dto);
        PageInfo<TStory> data = pageInfoR.getData();
        return AjaxResult.success(data);
@@ -53,7 +54,7 @@
    @ApiOperation(value = "新增或修改学习配置", tags = {"后台-学习"})
    @PostMapping(value = "/addStudySet")
    @ResponseBody
    public AjaxResult addStudySet(AddStudySetDTO dto) {
    public AjaxResult addStudySet(@RequestBody AddStudySetDTO dto) {
        studyClient.addStudySet(dto);
        return AjaxResult.success("保存成功");
    }
@@ -132,13 +133,13 @@
            @ApiImplicitParam(value = "id", name = "id", required = true),
            @ApiImplicitParam(value = "状态 1上架2下架3删除", name = "state", required = true),
    })
    public AjaxResult updateState(Integer id, Integer state) {
    public R updateState(Integer id, Integer state) {
        R update = studyClient.updateState(id,state);
        int code = update.getCode();
        if (code == 500){
            return AjaxResult.error(update.getMsg());
        if (code == 602){
            return R.failUpdate(update.getMsg());
        }
        return AjaxResult.success("修改成功");
        return R.ok("修改成功");
    }
    @ApiOperation(value = "添加", tags = {"后台-故事管理"})
    @PostMapping(value = "/addStory")
@@ -150,13 +151,14 @@
    @ApiOperation(value = "修改", tags = {"后台-故事管理"})
    @PostMapping(value = "/updateStory")
    @ResponseBody
    public AjaxResult updateStory(StoryDTO dto) {
    public R updateStory(StoryDTO dto) {
        R update = studyClient.update(dto);
        int code = update.getCode();
        if (code == 500){
            return AjaxResult.error(update.getMsg());
        if (code == 602){
            return R.failUpdate(update.getMsg());
        }
        return AjaxResult.success("添加成功");
        return R.ok("添加成功");
    }
    @ApiOperation(value = "查看详情", tags = {"后台-故事管理"})
    @PostMapping(value = "/getStoryInfo")
@@ -173,13 +175,13 @@
            @ApiImplicitParam(value = "id", name = "id", required = true),
            @ApiImplicitParam(value = "状态 1上架2下架3删除", name = "state", required = true),
    })
    public AjaxResult updateState1(Integer id, Integer state) {
    public R updateState1(Integer id, Integer state) {
        R update = studyClient.updateState1(id,state);
        int code = update.getCode();
        if (code == 500){
            return AjaxResult.error(update.getMsg());
        if (code == 602){
            return R.failUpdate(update.getMsg());
        }
        return AjaxResult.success("修改成功");
        return R.ok("修改成功");
    }
}