Search in sources :

Example 6 with ArticleConditionVO

use of com.zyd.blog.business.vo.ArticleConditionVO in project OneBlog by zhangyd-c.

the class BizArticleServiceImpl method listRandom.

/**
 * 随机文章
 *
 * @param pageSize
 * @return
 */
@Override
public List<Article> listRandom(int pageSize) {
    ArticleConditionVO vo = new ArticleConditionVO();
    vo.setRandom(true);
    vo.setStatus(ArticleStatusEnum.PUBLISHED.getCode());
    vo.setPageSize(pageSize);
    PageInfo pageInfo = this.findPageBreakByCondition(vo);
    return null == pageInfo ? null : pageInfo.getList();
}
Also used : PageInfo(com.github.pagehelper.PageInfo) ArticleConditionVO(com.zyd.blog.business.vo.ArticleConditionVO)

Example 7 with ArticleConditionVO

use of com.zyd.blog.business.vo.ArticleConditionVO in project OneBlog by zhangyd-c.

the class BizArticleServiceImpl method listRecent.

/**
 * 近期文章
 *
 * @param pageSize
 * @return
 */
@Override
public List<Article> listRecent(int pageSize) {
    ArticleConditionVO vo = new ArticleConditionVO();
    vo.setPageSize(pageSize);
    vo.setStatus(ArticleStatusEnum.PUBLISHED.getCode());
    PageInfo pageInfo = this.findPageBreakByCondition(vo);
    return null == pageInfo ? null : pageInfo.getList();
}
Also used : PageInfo(com.github.pagehelper.PageInfo) ArticleConditionVO(com.zyd.blog.business.vo.ArticleConditionVO)

Example 8 with ArticleConditionVO

use of com.zyd.blog.business.vo.ArticleConditionVO 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);
}
Also used : ArticleConditionVO(com.zyd.blog.business.vo.ArticleConditionVO) GetMapping(org.springframework.web.bind.annotation.GetMapping) BussinessLog(com.zyd.blog.business.annotation.BussinessLog)

Example 9 with ArticleConditionVO

use of com.zyd.blog.business.vo.ArticleConditionVO 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);
}
Also used : ArticleConditionVO(com.zyd.blog.business.vo.ArticleConditionVO) GetMapping(org.springframework.web.bind.annotation.GetMapping) BussinessLog(com.zyd.blog.business.annotation.BussinessLog)

Example 10 with ArticleConditionVO

use of com.zyd.blog.business.vo.ArticleConditionVO in project OneBlog by zhangyd-c.

the class RenderController method type.

/**
 * 分类列表(分页)
 *
 * @param typeId
 * @param pageNumber
 * @param model
 * @return
 */
@GetMapping("/type/{typeId}/{pageNumber}")
@BussinessLog(value = "进入文章分类[{1}]列表第{2}页", platform = PlatformEnum.WEB)
public ModelAndView type(@PathVariable("typeId") Long typeId, @PathVariable("pageNumber") Integer pageNumber, Model model) {
    ArticleConditionVO vo = new ArticleConditionVO();
    vo.setTypeId(typeId);
    vo.setPageNumber(pageNumber);
    model.addAttribute("url", "type/" + typeId);
    loadIndexPage(vo, model);
    return ResultUtil.view(INDEX_URL);
}
Also used : ArticleConditionVO(com.zyd.blog.business.vo.ArticleConditionVO) GetMapping(org.springframework.web.bind.annotation.GetMapping) BussinessLog(com.zyd.blog.business.annotation.BussinessLog)

Aggregations

ArticleConditionVO (com.zyd.blog.business.vo.ArticleConditionVO)10 PageInfo (com.github.pagehelper.PageInfo)5 BussinessLog (com.zyd.blog.business.annotation.BussinessLog)4 GetMapping (org.springframework.web.bind.annotation.GetMapping)4 Article (com.zyd.blog.business.entity.Article)2 PageHelper (com.github.pagehelper.PageHelper)1 RedisCache (com.zyd.blog.business.annotation.RedisCache)1 User (com.zyd.blog.business.entity.User)1 ArticleStatusEnum (com.zyd.blog.business.enums.ArticleStatusEnum)1 CommentStatusEnum (com.zyd.blog.business.enums.CommentStatusEnum)1 FileUploadType (com.zyd.blog.business.enums.FileUploadType)1 ResponseStatus (com.zyd.blog.business.enums.ResponseStatus)1 BizArticleService (com.zyd.blog.business.service.BizArticleService)1 BizArticleTagsService (com.zyd.blog.business.service.BizArticleTagsService)1 FileUploader (com.zyd.blog.file.FileUploader)1 VirtualFile (com.zyd.blog.file.entity.VirtualFile)1 ZhydArticleException (com.zyd.blog.framework.exception.ZhydArticleException)1 ZhydException (com.zyd.blog.framework.exception.ZhydException)1 RequestHolder (com.zyd.blog.framework.holder.RequestHolder)1 com.zyd.blog.persistence.beans (com.zyd.blog.persistence.beans)1