Skip to content

Commit

Permalink
add(article):添加Article缓存实现 #10
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonchenzhihao committed Jan 15, 2024
1 parent 51d74eb commit 35dd739
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cc.chenzhihao.typress.infras.cache;

import cc.chenzhihao.typress.commons.component.cache.MemoryCache;
import cc.chenzhihao.typress.core.domain.article.entity.Article;
import cc.chenzhihao.typress.core.domain.article.vo.ArticleID;
import cc.chenzhihao.typress.core.infras.cache.ArticleCache;
import org.springframework.stereotype.Component;

import java.time.Duration;

/**
* 基于内存的Article缓存
*
* @author chenzhihao
* @date 2024-01-15 17:52
*/
@Component
public class MemoryArticleCache extends MemoryCache<ArticleID, Article> implements ArticleCache {
private static final Duration duration = Duration.ofHours(12);

public MemoryArticleCache() {
super(duration);
}
}

0 comments on commit 35dd739

Please sign in to comment.