Skip to content

Commit

Permalink
fix(ci): spotlessCheck issues
Browse files Browse the repository at this point in the history
  • Loading branch information
azrael8576 committed Dec 1, 2023
1 parent 50d7bd6 commit c1d0174
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.wei.picquest.core.network.model.NetworkSearchImages
data class SearchImages(
val total: Int,
val totalHits: Int,
val images: List<ImageDetail>
val images: List<ImageDetail>,
)

data class ImageDetail(
Expand All @@ -31,7 +31,7 @@ data class ImageDetail(
val comments: Int,
val userId: Int,
val user: String,
val userImageURL: String
val userImageURL: String,
)

fun NetworkSearchImages.asExternalModel() = SearchImages(
Expand Down Expand Up @@ -61,7 +61,7 @@ fun NetworkSearchImages.asExternalModel() = SearchImages(
comments = networkImageDetail.comments,
userId = networkImageDetail.userId,
user = networkImageDetail.user,
userImageURL = networkImageDetail.userImageURL
userImageURL = networkImageDetail.userImageURL,
)
}
},
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.withContext
import java.io.PrintWriter
import javax.inject.Inject


/**
* Implementation of the [SearchImagesRepository].
* @param ioDispatcher 用於執行 IO 相關操作的 CoroutineDispatcher。
Expand All @@ -28,10 +26,10 @@ class DefaultSearchImagesRepository @Inject constructor(
* @return 一個 Flow,內容為 Search Images 的數據。
*/
override suspend fun getSearchImages(
query: String
query: String,
): Flow<NetworkSearchImages> = withContext(ioDispatcher) {
flow {
emit(network.searchImages(query))
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.wei.picquest.core.data.repository
import com.wei.picquest.core.network.model.NetworkSearchImages
import kotlinx.coroutines.flow.Flow


interface SearchImagesRepository {

suspend fun getSearchImages(query: String): Flow<NetworkSearchImages>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data class NetworkSearchImages(
@SerialName("totalHits")
val totalHits: Int,
@SerialName("hits")
val hits: List<NetworkImageDetail>
val hits: List<NetworkImageDetail>,
)

@Serializable
Expand Down Expand Up @@ -63,8 +63,8 @@ data class NetworkImageDetail(
@SerialName("user")
val user: String,
@SerialName("userImageURL")
val userImageURL: String
val userImageURL: String,
// Add vectorURL if your account has full API access
// @SerialName("vectorURL")
// val vectorURL: String? = null
)
)

0 comments on commit c1d0174

Please sign in to comment.