无关风月
2025-03-21 6903c41af2520b23809ca90e9a211e738de2c224
ruoyi-service/ruoyi-management/src/main/java/com/ruoyi/management/controller/TStudyController.java
@@ -55,7 +55,12 @@
    @PostMapping(value = "/addStudySet")
    @ResponseBody
    public AjaxResult addStudySet(@RequestBody AddStudySetDTO dto) {
        studyClient.addStudySet(dto);
        R<Object> objectR = studyClient.addStudySet(dto);
        int code = objectR.getCode();
        if (code == 500){
            String string = objectR.getMsg().toString();
            return AjaxResult.error(string);
        }
        return AjaxResult.success("保存成功");
    }
@@ -133,13 +138,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")
@@ -151,13 +156,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")
@@ -174,13 +180,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("修改成功");
    }
}