| | |
| | | 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; |
| | | |
| | |
| | | @ApiOperation(value = "新增或修改学习配置", tags = {"后台-学习"}) |
| | | @PostMapping(value = "/addStudySet") |
| | | @ResponseBody |
| | | public AjaxResult addStudySet(AddStudySetDTO dto) { |
| | | public AjaxResult addStudySet(@RequestBody AddStudySetDTO dto) { |
| | | studyClient.addStudySet(dto); |
| | | return AjaxResult.success("保存成功"); |
| | | } |
| | |
| | | @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") |
| | |
| | | @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") |
| | |
| | | @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("修改成功"); |
| | | } |
| | | } |
| | | |