Initialize v1 support

This commit is contained in:
Kirill Kamakin
2022-08-07 17:19:35 +02:00
parent 684b492fb2
commit 95205f8ffe
24 changed files with 478 additions and 26 deletions

View File

@@ -9,5 +9,5 @@ interface RecipeRepo {
suspend fun clearLocalData()
suspend fun loadRecipeInfo(recipeId: Long, recipeSlug: String): FullRecipeInfo
suspend fun loadRecipeInfo(recipeId: String, recipeSlug: String): FullRecipeInfo
}

View File

@@ -17,5 +17,5 @@ interface RecipeStorage {
suspend fun saveRecipeInfo(recipe: GetRecipeResponse)
suspend fun queryRecipeInfo(recipeId: Long): FullRecipeInfo
suspend fun queryRecipeInfo(recipeId: String): FullRecipeInfo
}

View File

@@ -132,7 +132,7 @@ class RecipeStorageImpl @Inject constructor(
}
}
override suspend fun queryRecipeInfo(recipeId: Long): FullRecipeInfo {
override suspend fun queryRecipeInfo(recipeId: String): FullRecipeInfo {
logger.v { "queryRecipeInfo() called with: recipeId = $recipeId" }
val fullRecipeInfo = checkNotNull(recipeDao.queryFullRecipeInfo(recipeId)) {
"Can't find recipe by id $recipeId in DB"

View File

@@ -38,7 +38,7 @@ class RecipeRepoImpl @Inject constructor(
storage.clearAllLocalData()
}
override suspend fun loadRecipeInfo(recipeId: Long, recipeSlug: String): FullRecipeInfo {
override suspend fun loadRecipeInfo(recipeId: String, recipeSlug: String): FullRecipeInfo {
logger.v { "loadRecipeInfo() called with: recipeId = $recipeId, recipeSlug = $recipeSlug" }
runCatchingExceptCancel {