Search in sources :

Example 6 with RedisCache

use of com.zyd.blog.business.annotation.RedisCache in project OneBlog by zhangyd-c.

the class SysLinkServiceImpl method listOfIndex.

/**
 * 查询可在首页显示的友情链接列表
 *
 * @return
 */
@Override
@RedisCache
public List<Link> listOfIndex() {
    LinkConditionVO vo = new LinkConditionVO(1, 1);
    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)

Example 7 with RedisCache

use of com.zyd.blog.business.annotation.RedisCache in project OneBlog by zhangyd-c.

the class SysLinkServiceImpl method listOfDisable.

/**
 * 查询已禁用的友情链接列表
 *
 * @return
 */
@Override
@RedisCache
public List<Link> listOfDisable() {
    LinkConditionVO vo = new LinkConditionVO(0, null);
    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)

Example 8 with RedisCache

use of com.zyd.blog.business.annotation.RedisCache in project OneBlog by zhangyd-c.

the class SysConfigServiceImpl method getByKey.

@Override
@RedisCache(enable = false)
public SysConfig getByKey(String key) {
    if (StringUtils.isEmpty(key)) {
        return null;
    }
    SysConfig sysConfig = new SysConfig();
    sysConfig.setConfigKey(key);
    return this.sysConfigMapper.selectOne(sysConfig);
}
Also used : SysConfig(com.zyd.blog.persistence.beans.SysConfig) RedisCache(com.zyd.blog.business.annotation.RedisCache)

Example 9 with RedisCache

use of com.zyd.blog.business.annotation.RedisCache in project OneBlog by zhangyd-c.

the class SysConfigServiceImpl method saveFile.

@Override
@RedisCache(flush = true, enable = false)
public void saveFile(String key, MultipartFile file) {
    if (key == null) {
        return;
    }
    if (file != null) {
        FileUploader uploader = new GlobalFileUploader();
        VirtualFile virtualFile = uploader.upload(file, FileUploadType.QRCODE.getPath(), true);
        this.saveConfig(key, virtualFile.getFullFilePath());
    }
}
Also used : VirtualFile(com.zyd.blog.file.entity.VirtualFile) GlobalFileUploader(com.zyd.blog.plugin.file.GlobalFileUploader) FileUploader(com.zyd.blog.file.FileUploader) GlobalFileUploader(com.zyd.blog.plugin.file.GlobalFileUploader) RedisCache(com.zyd.blog.business.annotation.RedisCache)

Example 10 with RedisCache

use of com.zyd.blog.business.annotation.RedisCache 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

RedisCache (com.zyd.blog.business.annotation.RedisCache)15 Link (com.zyd.blog.business.entity.Link)4 SysLink (com.zyd.blog.persistence.beans.SysLink)4 LinkConditionVO (com.zyd.blog.business.vo.LinkConditionVO)3 ZhydException (com.zyd.blog.framework.exception.ZhydException)3 SysConfig (com.zyd.blog.persistence.beans.SysConfig)3 Date (java.util.Date)3 Transactional (org.springframework.transaction.annotation.Transactional)3 User (com.zyd.blog.business.entity.User)2 BizArticleTags (com.zyd.blog.persistence.beans.BizArticleTags)2 Tags (com.zyd.blog.business.entity.Tags)1 CommentConditionVO (com.zyd.blog.business.vo.CommentConditionVO)1 FileUploader (com.zyd.blog.file.FileUploader)1 VirtualFile (com.zyd.blog.file.entity.VirtualFile)1 ZhydArticleException (com.zyd.blog.framework.exception.ZhydArticleException)1 ZhydCommentException (com.zyd.blog.framework.exception.ZhydCommentException)1 ZhydLinkException (com.zyd.blog.framework.exception.ZhydLinkException)1 BizComment (com.zyd.blog.persistence.beans.BizComment)1 BizTags (com.zyd.blog.persistence.beans.BizTags)1 GlobalFileUploader (com.zyd.blog.plugin.file.GlobalFileUploader)1