Search in sources :

Example 6 with Link

use of com.zyd.blog.business.entity.Link in project OneBlog by zhangyd-c.

the class SysLinkServiceImpl method findPageBreakByCondition.

@Override
public PageInfo<Link> findPageBreakByCondition(LinkConditionVO vo) {
    PageHelper.startPage(vo.getPageNumber(), vo.getPageSize());
    List<SysLink> list = sysLinkMapper.findPageBreakByCondition(vo);
    if (CollectionUtils.isEmpty(list)) {
        return null;
    }
    List<Link> boList = new ArrayList<>();
    for (SysLink sysLink : list) {
        boList.add(new Link(sysLink));
    }
    PageInfo bean = new PageInfo<SysLink>(list);
    bean.setList(boList);
    return bean;
}
Also used : PageInfo(com.github.pagehelper.PageInfo) Link(com.zyd.blog.business.entity.Link) SysLink(com.zyd.blog.persistence.beans.SysLink) SysLink(com.zyd.blog.persistence.beans.SysLink)

Example 7 with Link

use of com.zyd.blog.business.entity.Link in project OneBlog by zhangyd-c.

the class SysLinkServiceImpl method getOneByUrl.

@Override
public Link getOneByUrl(String url) {
    SysLink l = new SysLink();
    l.setUrl(url);
    l = sysLinkMapper.selectOne(l);
    return null == l ? null : new Link(l);
}
Also used : Link(com.zyd.blog.business.entity.Link) SysLink(com.zyd.blog.persistence.beans.SysLink) SysLink(com.zyd.blog.persistence.beans.SysLink)

Example 8 with Link

use of com.zyd.blog.business.entity.Link in project OneBlog by zhangyd-c.

the class SysLinkServiceImpl method listOfInside.

/**
 * 查询可在内页显示的友情链接列表
 *
 * @return
 */
@Override
@RedisCache
public List<Link> listOfInside() {
    LinkConditionVO vo = new LinkConditionVO(1, 0);
    vo.setPageSize(100);
    PageInfo<Link> pageInfo = this.findPageBreakByCondition(vo);
    return pageInfo == null ? null : pageInfo.getList();
}
Also used : LinkConditionVO(com.zyd.blog.business.vo.LinkConditionVO) Link(com.zyd.blog.business.entity.Link) SysLink(com.zyd.blog.persistence.beans.SysLink) RedisCache(com.zyd.blog.business.annotation.RedisCache)

Aggregations

Link (com.zyd.blog.business.entity.Link)8 SysLink (com.zyd.blog.persistence.beans.SysLink)7 RedisCache (com.zyd.blog.business.annotation.RedisCache)4 LinkConditionVO (com.zyd.blog.business.vo.LinkConditionVO)3 PageInfo (com.github.pagehelper.PageInfo)1 ZhydLinkException (com.zyd.blog.framework.exception.ZhydLinkException)1 SysConfig (com.zyd.blog.persistence.beans.SysConfig)1 Scheduled (org.springframework.scheduling.annotation.Scheduled)1