Skip to content

Commit b8a1214

Browse files
authored
Merge pull request #119 from YAPP-Github/refactor/#117-bookmark-naming
[refactor] #117 scrap -> bookmark 리네이밍
2 parents b2d3e4f + 66dd019 commit b8a1214

27 files changed

Lines changed: 157 additions & 158 deletions

File tree

core/data-api/src/main/java/com/neki/android/core/dataapi/repository/PoseRepository.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface PoseRepository {
1313
sortOrder: SortOrder = SortOrder.DESC,
1414
): Flow<PagingData<Pose>>
1515

16-
fun getScrappedPosesFlow(
16+
fun getBookmarkedPosesFlow(
1717
sortOrder: SortOrder = SortOrder.DESC,
1818
): Flow<PagingData<Pose>>
1919

@@ -30,5 +30,5 @@ interface PoseRepository {
3030
poseSize: Int,
3131
): Result<List<Pose>>
3232

33-
suspend fun updateScrap(poseId: Long, scrap: Boolean): Result<Unit>
33+
suspend fun updateBookmark(poseId: Long, bookmark: Boolean): Result<Unit>
3434
}

core/data/src/main/java/com/neki/android/core/data/paging/ScrapPosePagingSource.kt renamed to core/data/src/main/java/com/neki/android/core/data/paging/BookmarkPosePagingSource.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import com.neki.android.core.data.remote.api.PoseService
66
import com.neki.android.core.model.Pose
77
import com.neki.android.core.model.SortOrder
88

9-
class ScrapPosePagingSource(
9+
class BookmarkPosePagingSource(
1010
private val poseService: PoseService,
1111
private val sortOrder: SortOrder,
1212
) : PagingSource<Int, Pose>() {
1313

1414
override suspend fun load(params: LoadParams<Int>): LoadResult<Int, Pose> {
1515
return try {
1616
val page = params.key ?: 0
17-
val poses = poseService.getScrappedPoses(
17+
val poses = poseService.getBookmarkedPoses(
1818
page = page,
1919
size = params.loadSize,
2020
sortOrder = sortOrder.name,

core/data/src/main/java/com/neki/android/core/data/remote/api/PoseService.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.neki.android.core.data.remote.api
22

3-
import com.neki.android.core.data.remote.model.request.UpdateScrapRequest
3+
import com.neki.android.core.data.remote.model.request.UpdateBookmarkRequest
44
import com.neki.android.core.data.remote.model.response.BasicNullableResponse
55
import com.neki.android.core.data.remote.model.response.BasicResponse
66
import com.neki.android.core.data.remote.model.response.PoseDetailResponse
@@ -44,8 +44,8 @@ class PoseService @Inject constructor(
4444
}.body()
4545
}
4646

47-
// 스크랩된 포즈 목록 조회
48-
suspend fun getScrappedPoses(
47+
// 북마크된 포즈 목록 조회
48+
suspend fun getBookmarkedPoses(
4949
page: Int = 0,
5050
size: Int = 20,
5151
sortOrder: String = "DESC",
@@ -57,10 +57,10 @@ class PoseService @Inject constructor(
5757
}.body()
5858
}
5959

60-
// 스크랩 업데이트
61-
suspend fun updateScrap(poseId: Long, scrap: Boolean): BasicNullableResponse<Unit> {
60+
// 북마크 업데이트
61+
suspend fun updateBookmark(poseId: Long, bookmark: Boolean): BasicNullableResponse<Unit> {
6262
return client.patch("/api/poses/$poseId/scrap") {
63-
setBody(UpdateScrapRequest(scrap))
63+
setBody(UpdateBookmarkRequest(bookmark))
6464
}.body()
6565
}
6666
}

core/data/src/main/java/com/neki/android/core/data/remote/model/request/UpdateScrapRequest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import kotlinx.serialization.SerialName
44
import kotlinx.serialization.Serializable
55

66
@Serializable
7-
data class UpdateScrapRequest(
8-
@SerialName("scrap") val scrap: Boolean,
7+
data class UpdateBookmarkRequest(
8+
@SerialName("scrap") val bookmark: Boolean,
99
)

core/data/src/main/java/com/neki/android/core/data/remote/model/response/PoseDetailResponse.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ data class PoseDetailResponse(
1010
@SerialName("poseId") val poseId: Long,
1111
@SerialName("headCount") val headCount: String,
1212
@SerialName("imageUrl") val imageUrl: String,
13-
@SerialName("scrap") val scrap: Boolean,
13+
@SerialName("scrap") val bookmark: Boolean,
1414
@SerialName("contentType") val contentType: String,
1515
@SerialName("createdAt") val createdAt: String,
1616
) {
1717
internal fun toModel() = Pose(
1818
id = poseId,
19-
isScrapped = scrap,
19+
isBookmarked = bookmark,
2020
poseImageUrl = imageUrl,
2121
peopleCount = PeopleCount.entries.find { it.name == headCount }?.value ?: 1,
2222
)

core/data/src/main/java/com/neki/android/core/data/remote/model/response/PoseResponse.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ data class PoseResponse(
1515
@SerialName("poseId") val poseId: Long,
1616
@SerialName("headCount") val headCount: String,
1717
@SerialName("imageUrl") val imageUrl: String,
18-
@SerialName("scrap") val scrap: Boolean,
18+
@SerialName("scrap") val bookmark: Boolean,
1919
@SerialName("contentType") val contentType: String,
2020
@SerialName("createdAt") val createdAt: String,
2121
) {
2222
internal fun toModel() = Pose(
2323
id = poseId,
2424
poseImageUrl = imageUrl,
2525
peopleCount = PeopleCount.entries.find { it.name == headCount }?.value ?: 1,
26-
isScrapped = scrap,
26+
isBookmarked = bookmark,
2727
)
2828
}
2929

core/data/src/main/java/com/neki/android/core/data/repository/impl/PoseRepositoryImpl.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import androidx.paging.PagingData
66
import com.neki.android.core.common.exception.ApiErrorCode.NO_MORE_RANDOM_POSE
77
import com.neki.android.core.common.exception.NoMorePoseException
88
import com.neki.android.core.data.paging.PosePagingSource
9-
import com.neki.android.core.data.paging.ScrapPosePagingSource
9+
import com.neki.android.core.data.paging.BookmarkPosePagingSource
1010
import com.neki.android.core.data.remote.api.PoseService
1111
import com.neki.android.core.data.util.runSuspendCatching
1212
import com.neki.android.core.dataapi.repository.PoseRepository
@@ -45,7 +45,7 @@ class PoseRepositoryImpl @Inject constructor(
4545
).flow
4646
}
4747

48-
override fun getScrappedPosesFlow(
48+
override fun getBookmarkedPosesFlow(
4949
sortOrder: SortOrder,
5050
): Flow<PagingData<Pose>> {
5151
return Pager(
@@ -56,7 +56,7 @@ class PoseRepositoryImpl @Inject constructor(
5656
enablePlaceholders = false,
5757
),
5858
pagingSourceFactory = {
59-
ScrapPosePagingSource(
59+
BookmarkPosePagingSource(
6060
poseService = poseService,
6161
sortOrder = sortOrder,
6262
)
@@ -115,7 +115,7 @@ class PoseRepositoryImpl @Inject constructor(
115115
return@runSuspendCatching result
116116
}
117117

118-
override suspend fun updateScrap(poseId: Long, scrap: Boolean): Result<Unit> = runSuspendCatching {
119-
poseService.updateScrap(poseId, scrap)
118+
override suspend fun updateBookmark(poseId: Long, bookmark: Boolean): Result<Unit> = runSuspendCatching {
119+
poseService.updateBookmark(poseId, bookmark)
120120
}
121121
}

core/designsystem/src/main/java/com/neki/android/core/designsystem/actionbar/NekiActionBar.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private fun NekiEndActionBarPreview() {
123123
onClick = {},
124124
) {
125125
Icon(
126-
imageVector = ImageVector.vectorResource(R.drawable.icon_scrap_stroked),
126+
imageVector = ImageVector.vectorResource(R.drawable.icon_bookmark_stroked),
127127
contentDescription = null,
128128
tint = NekiTheme.colorScheme.gray500,
129129
)
@@ -156,7 +156,7 @@ private fun NekiBothSidesActionBarPreview() {
156156
onClick = {},
157157
) {
158158
Icon(
159-
imageVector = ImageVector.vectorResource(R.drawable.icon_scrap_stroked),
159+
imageVector = ImageVector.vectorResource(R.drawable.icon_bookmark_stroked),
160160
contentDescription = null,
161161
tint = NekiTheme.colorScheme.gray500,
162162
)

core/designsystem/src/main/res/drawable/icon_scrap_filled.xml renamed to core/designsystem/src/main/res/drawable/icon_bookmark_filled.xml

File renamed without changes.

core/designsystem/src/main/res/drawable/icon_scrap_stroked.xml renamed to core/designsystem/src/main/res/drawable/icon_bookmark_stroked.xml

File renamed without changes.

0 commit comments

Comments
 (0)