use of com.zyd.blog.framework.exception.ZhydException in project OneBlog by zhangyd-c.
the class RenderController method edit.
@RequiresPermissions("article:publish")
@BussinessLog(value = "进入修改文章页[id={1}]")
@GetMapping("/article/update/{id}")
public ModelAndView edit(@PathVariable("id") Long id, Model model) {
model.addAttribute("id", id);
Article article = articleService.getByPrimaryKey(id);
if (!Arrays.asList("we", "md", "tiny").contains(article.getEditorType())) {
throw new ZhydException("文章异常,未知的编辑器类型");
}
return ResultUtil.view("article/publish-" + article.getEditorType());
}
Aggregations