-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jacksonchenzhihao
committed
Jan 15, 2024
1 parent
51d74eb
commit 35dd739
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
24 changes: 24 additions & 0 deletions
24
...ess-infras-cache/src/main/java/cc/chenzhihao/typress/infras/cache/MemoryArticleCache.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |