use of com.zyd.blog.business.annotation.BussinessLog in project OneBlog by zhangyd-c.
the class RestNoticeController method release.
@RequiresPermissions("notice:release")
@PostMapping("/release/{id}")
@BussinessLog("发布公告通知")
public ResponseVO release(@PathVariable Long id) {
try {
Notice notice = new Notice();
notice.setId(id);
notice.setStatus(NoticeStatusEnum.RELEASE.toString());
noticeService.updateSelective(notice);
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error("通知发布失败,状态不变!");
}
return ResultUtil.success("该通知已发布,可去前台页面查看效果!");
}
use of com.zyd.blog.business.annotation.BussinessLog in project OneBlog by zhangyd-c.
the class RestNoticeController method add.
@RequiresPermissions("notice:add")
@PostMapping(value = "/add")
@BussinessLog("添加公告通知")
public ResponseVO add(Notice notice) {
User user = SessionUtil.getUser();
if (null != user) {
notice.setUserId(user.getId());
}
noticeService.insert(notice);
return ResultUtil.success("系统通知添加成功");
}
use of com.zyd.blog.business.annotation.BussinessLog in project OneBlog by zhangyd-c.
the class RestNoticeController method withdraw.
@RequiresPermissions("notice:withdraw")
@PostMapping("/withdraw/{id}")
@BussinessLog("撤回公告通知")
public ResponseVO withdraw(@PathVariable Long id) {
try {
Notice notice = new Notice();
notice.setId(id);
notice.setStatus(NoticeStatusEnum.NOT_RELEASE.toString());
noticeService.updateSelective(notice);
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error("通知撤回失败,状态不变!");
}
return ResultUtil.success("该通知已撤回,可修改后重新发布!");
}
use of com.zyd.blog.business.annotation.BussinessLog in project OneBlog by zhangyd-c.
the class RenderController method tag.
/**
* 标签列表
*
* @param tagId
* @param model
* @return
*/
@GetMapping("/tag/{tagId}")
@BussinessLog(value = "进入文章标签[{1}]列表页", platform = PlatformEnum.WEB)
public ModelAndView tag(@PathVariable("tagId") Long tagId, Model model) {
ArticleConditionVO vo = new ArticleConditionVO();
vo.setTagId(tagId);
model.addAttribute("url", "tag/" + tagId);
loadIndexPage(vo, model);
return ResultUtil.view(INDEX_URL);
}
use of com.zyd.blog.business.annotation.BussinessLog in project OneBlog by zhangyd-c.
the class RenderController method tag.
/**
* 标签列表(分页)
*
* @param tagId
* @param pageNumber
* @param model
* @return
*/
@GetMapping("/tag/{tagId}/{pageNumber}")
@BussinessLog(value = "进入文章标签[{1}]列表第{2}页", platform = PlatformEnum.WEB)
public ModelAndView tag(@PathVariable("tagId") Long tagId, @PathVariable("pageNumber") Integer pageNumber, Model model) {
ArticleConditionVO vo = new ArticleConditionVO();
vo.setTagId(tagId);
vo.setPageNumber(pageNumber);
model.addAttribute("url", "tag/" + tagId);
loadIndexPage(vo, model);
return ResultUtil.view(INDEX_URL);
}
Aggregations