|
|
|
@ -28,10 +28,6 @@ object CacheManager { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun putString2File(key: String, value: String, saveTime: Int = 0) { |
|
|
|
|
ACache.get(appCtx).put(key, value, saveTime) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun get(key: String): String? { |
|
|
|
|
return appDb.cacheDao.get(key, System.currentTimeMillis()) |
|
|
|
|
} |
|
|
|
@ -56,10 +52,6 @@ object CacheManager { |
|
|
|
|
return ACache.get(appCtx).getAsBinary(key) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun getString(key: String): String? { |
|
|
|
|
return ACache.get(appCtx).getAsString(key) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun getQueryTTF(key: String): QueryTTF? { |
|
|
|
|
val cache = queryTTFMap[key] ?: return null |
|
|
|
|
if (cache.first == 0L || cache.first > System.currentTimeMillis()) { |
|
|
|
@ -68,6 +60,14 @@ object CacheManager { |
|
|
|
|
return null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun putFile(key: String, value: String, saveTime: Int = 0) { |
|
|
|
|
ACache.get(appCtx).put(key, value, saveTime) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun getFile(key: String): String? { |
|
|
|
|
return ACache.get(appCtx).getAsString(key) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun delete(key: String) { |
|
|
|
|
appDb.cacheDao.delete(key) |
|
|
|
|
ACache.get(appCtx).remove(key) |
|
|
|
|