Skip to content

Commit 0eb7169

Browse files
committed
feat/#99: qa 3차 수정 - archived api 연결 오류 해결
1 parent a606f3f commit 0eb7169

File tree

11 files changed

+42
-37
lines changed

11 files changed

+42
-37
lines changed

app/src/main/java/com/paw/key/core/designsystem/component/CourseCard.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import androidx.compose.ui.graphics.vector.ImageVector
1818
import androidx.compose.ui.layout.ContentScale
1919
import androidx.compose.ui.platform.LocalConfiguration
2020
import androidx.compose.ui.platform.LocalContext
21+
import androidx.compose.ui.res.painterResource
2122
import androidx.compose.ui.res.vectorResource
2223
import androidx.compose.ui.tooling.preview.Preview
2324
import androidx.compose.ui.unit.dp
@@ -32,20 +33,15 @@ fun CourseCard(
3233
postId: Long,
3334
title: String,
3435
createdAt: String,
35-
representativeImageUrl: String,
3636
petName: String,
37-
petProfileImageUrl: String,
38-
descriptionTags: List<String>,
3937
isLiked: Boolean,
4038
onClickItem: () -> Unit,
41-
modifier: Modifier = Modifier
42-
petName: String,
39+
modifier: Modifier = Modifier,
4340
date: String,
4441
representativeImageUrl: String? = null, // 추가
4542
petProfileImageUrl: String? = null, // 추가
4643
descriptionTags: List<String> = emptyList(), // 추가
4744
onCLickItem: () -> Unit,
48-
modifier: Modifier = Modifier,
4945
isShared: Boolean = false,
5046
isRecord: Boolean = false
5147
) {
@@ -175,8 +171,8 @@ fun CourseCard(
175171
color = Color.White
176172
)
177173
Spacer(modifier = Modifier.width(8.dp))
174+
178175
Text(
179-
text = createdAt,
180176
text = formatDate(date), // 포맷된 날짜 사용
181177
style = PawKeyTheme.typography.caption12R,
182178
color = PawKeyTheme.colors.gray100
@@ -227,7 +223,11 @@ fun CourseCardPreview() {
227223
petProfileImageUrl = "https://pawkey-server.com/profile.jpg",
228224
descriptionTags = listOf("이륜차 거의 없음", "물그릇 비치", "쉴 곳 있음"),
229225
isLiked = true,
230-
onClickItem = {}
226+
onCLickItem = {},
227+
onClickItem = {},
228+
date = "2025/07/16",
229+
isShared = true,
230+
isRecord = true,
231231
)
232232
}
233233
}

app/src/main/java/com/paw/key/data/dto/response/ArchivedListResponseDto.kt

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,9 @@ import com.paw.key.domain.model.entity.archivedlist.WriterEntity
66
import kotlinx.serialization.SerialName
77
import kotlinx.serialization.Serializable
88

9-
@Serializable
10-
data class ArchivedListResponseDto(
11-
@SerialName("code")
12-
val code: String,
13-
@SerialName("message")
14-
val message: String,
15-
@SerialName("data")
16-
val data: ArchivedListResponseDataDto
17-
)
18-
199
@Serializable
2010
data class ArchivedListResponseDataDto(
11+
@SerialName("posts")
2112
val posts: List<ArchivedDto>
2213
) {
2314
fun toEntity() = ArchivedListPostsEntity(
@@ -38,7 +29,7 @@ data class ArchivedDto(
3829
@SerialName("representativeImageUrl")
3930
val representativeImageUrl: String? = null,
4031
@SerialName("routeId")
41-
val routeId: String,
32+
val routeId: Int,
4233
@SerialName("writer")
4334
val writer: WriterDto,
4435
@SerialName("descriptionTags")
@@ -50,6 +41,7 @@ data class ArchivedDto(
5041
isLiked = isLike,
5142
title = title,
5243
representativeImageUrl = representativeImageUrl ?: "",
44+
routeId = routeId.toLong(),
5345
writer = listOf(writer.toEntity()),
5446
descriptionTags = descriptionTags
5547
)
@@ -64,7 +56,7 @@ data class WriterDto(
6456
@SerialName("petProfileImageUrl")
6557
val petProfileImageUrl: String
6658
) {
67-
fun toEntity() = WriterEntity (
59+
fun toEntity() = WriterEntity(
6860
userId = userId.toLong(),
6961
petName = petName,
7062
petProfileImageUrl = petProfileImageUrl

app/src/main/java/com/paw/key/data/remote/datasource/ArchivedListDataSource.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ class ArchivedListDataSource @Inject constructor(
77
private val archivedListService: ArchivedListService
88
) {
99
suspend fun getArchivedList(userId: Int) = archivedListService.getArchivedList(userId)
10-
}
10+
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.paw.key.data.service
22

33
import com.paw.key.data.dto.response.ArchivedListResponseDataDto
4-
import com.paw.key.data.dto.response.ArchivedListResponseDto
54
import com.paw.key.data.dto.response.BaseResponse
65
import retrofit2.http.GET
76
import retrofit2.http.Header
@@ -10,6 +9,5 @@ interface ArchivedListService {
109
@GET("users/me/posts")
1110
suspend fun getArchivedList(
1211
@Header("X-USER-ID") userId: Int
13-
): ArchivedListResponseDto
14-
15-
}
12+
): BaseResponse<ArchivedListResponseDataDto>
13+
}

app/src/main/java/com/paw/key/domain/model/entity/archivedlist/ArchivedListEntity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ data class ArchivedListEntity(
1010
val isLiked: Boolean,
1111
val title: String,
1212
val representativeImageUrl: String,
13+
val routeId: Long,
1314
val writer: List<WriterEntity>,
1415
val descriptionTags: List<String>
1516
)
17+
1618
data class WriterEntity(
1719
val userId: Long,
1820
val petName: String,

app/src/main/java/com/paw/key/presentation/ui/course/entire/tab/map/List/TabListScreen.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,14 @@ fun TabListScreen(
132132
petProfileImageUrl = post.writer.petProfileImageUrl,
133133
descriptionTags = post.descriptionTags,
134134
isRecord = post.isLike,
135+
postId = post.postId.toLong(),
136+
createdAt = post.createdAt,
137+
isLiked = post.isLike,
135138
onCLickItem = {
136139
navigateToDetail()
140+
},
141+
onClickItem = {
142+
//showBottomSheet = true
137143
}
138144
)
139145
}

app/src/main/java/com/paw/key/presentation/ui/home/HomeScreen.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ fun HomeScreen(
164164
descriptionTags = listOf("이륜차 거의 없음", "물그릇 비치", "쉴 곳 있음"),
165165
onClickItem = {},
166166
isLiked = true,
167-
postId = 1L
167+
postId = 1L,
168+
onCLickItem = {},
169+
isRecord = true,
170+
date = "년도/월/일"
168171
)
169172
Spacer(modifier = Modifier.height(48.dp))
170173
}

app/src/main/java/com/paw/key/presentation/ui/mypage/ArchivedCourseListScreen.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ fun ArchivedCourseListScreen(
6767
petProfileImageUrl = item.writer.first().petProfileImageUrl,
6868
descriptionTags = item.descriptionTags,
6969
isLiked = item.isLiked,
70-
onClickItem = navigateNext
70+
onClickItem = navigateNext,
71+
onCLickItem = navigateNext,
72+
date = item.createdAt
7173
)
7274
}
7375
}

app/src/main/java/com/paw/key/presentation/ui/mypage/SavedCourseListScreen.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ fun SavedCourseListScreen(
6565
petProfileImageUrl = item.writer.first().petProfileImageUrl,
6666
descriptionTags = item.descriptionTags,
6767
isLiked = item.isLiked,
68-
onClickItem = navigateNext
68+
onClickItem = navigateNext,
69+
onCLickItem = {},
70+
isRecord = true,
71+
date = "년도/월/일"
6972
)
7073
}
7174
}

app/src/main/java/com/paw/key/presentation/ui/mypage/state/SavedListContract.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package com.paw.key.presentation.ui.mypage.state
22

33
import androidx.compose.runtime.Immutable
4+
import com.paw.key.domain.model.entity.archivedlist.ArchivedListEntity
45
import com.paw.key.domain.model.entity.savedlist.SavedListEntity
56

67
@Immutable
78
data class SavedListState(
8-
val courseList: List<SavedListEntity> = emptyList()
9+
val courseList: List<ArchivedListEntity> = emptyList()
910
)
1011

1112
//@Immutable

0 commit comments

Comments
 (0)