getCache method

Future<HttpCacheObj?>? getCache(
  1. String cacheKey
)

获取缓存

Implementation

Future<HttpCacheObj?>? getCache(String cacheKey) async {
  try {
    var map = await _database
        ?.query("HttpCacheObj", where: "cacheKey = ?", whereArgs: [cacheKey]);
    Map<String, dynamic>? cacheMap = map?.firstOrNull;
    if (cacheMap != null) {
      return HttpCacheObj(cacheMap["cacheKey"], cacheMap["cacheValue"],
          cacheMap["expireTime"]);
    }
  } catch (e) {
    return null;
  }
  return null;
}