-
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.
feat(#53): converted common CacheType classes java to kotlin
- Loading branch information
1 parent
e03631d
commit 11ebfb9
Showing
3 changed files
with
22 additions
and
36 deletions.
There are no files selected for viewing
35 changes: 0 additions & 35 deletions
35
archive-common/src/main/java/site/archive/common/cache/CacheType.java
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
archive-common/src/main/java/site/archive/common/cache/CacheType.kt
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,21 @@ | ||
package site.archive.common.cache | ||
|
||
enum class CacheType(val key: String, val expireAfterWrite: Int, val maximumSize: Int) { | ||
|
||
BANNERS(CacheInfo.BANNERS, CacheInfo.BANNERS_GET_EXPIRE_TIME, CacheInfo.BANNERS_CACHE_SIZE), | ||
ARCHIVE_COMMUNITIES(CacheInfo.ARCHIVE_COMMUNITIES, CacheInfo.ARCHIVE_COMMUNITIES_GET_EXPIRE_TIME, CacheInfo.ARCHIVE_COMMUNITIES_CACHE_SIZE) | ||
; | ||
|
||
class CacheInfo { | ||
companion object { | ||
const val BANNERS: String = "banners" | ||
const val BANNERS_GET_EXPIRE_TIME: Int = 3_600 | ||
const val BANNERS_CACHE_SIZE: Int = 1 | ||
|
||
const val ARCHIVE_COMMUNITIES: String = "archive-communities" | ||
const val ARCHIVE_COMMUNITIES_GET_EXPIRE_TIME: Int = 30 | ||
const val ARCHIVE_COMMUNITIES_CACHE_SIZE: Int = 200 | ||
} | ||
} | ||
|
||
} |
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