[Feat/#8]1 상세화면 v3 api 업데이트 및 iOS 평가 사진 업로드 안되는 이슈 수정#82
Conversation
- bytearray 크기 명시 함수를 통해 NSULRSESSION 크기 먼저 확인하도록 수정
📝 WalkthroughWalkthrough이 변경 사항은 세 가지 주요 업데이트로 구성됩니다: DetailApi에서 모든 HTTP 엔드포인트 경로를 Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
shared/data/detail/src/commonMain/kotlin/com/kus/kustaurant/detail/api/DetailApi.kt (1)
25-25: API 버전 prefix를 상수로 분리하면 다음 버전 변경 누락 위험을 줄일 수 있습니다.현재
/api/v3가 여러 엔드포인트에 반복되어 있어 이후/api/v4등으로 변경할 때 일부 라인만 빠질 가능성이 있습니다. 이번처럼 버전 prefix만 일괄 변경되는 구조라면private companion object상수로 두는 편이 더 안전합니다.♻️ 제안 diff
class DetailApi( private val client: HttpClient, ) { + private companion object { + const val API_V3 = "/api/v3" + } + suspend fun getRestaurantDetail(restaurantId: Long): DetailResponse { - return client.get("/api/v3/restaurants/$restaurantId").body() + return client.get("$API_V3/restaurants/$restaurantId").body() } suspend fun getRestaurantReviews( restaurantId: Long, sort: String = "POPULARITY" ): List<ReviewResponse> { - return client.get("/api/v3/restaurants/$restaurantId/comments") { + return client.get("$API_V3/restaurants/$restaurantId/comments") { parameter("sort", sort) }.body() } suspend fun putEvaluationReaction( evaluationId: Int, reaction: String?, ): EvaluationReactionResponse { - return client.put("/api/v3/auth/restaurants/evaluations/$evaluationId/reaction") { + return client.put("$API_V3/auth/restaurants/evaluations/$evaluationId/reaction") { reaction?.let { parameter("reaction", it) } }.body() } suspend fun putCommentReaction( evalCommentId: Int, reaction: String?, ): CommentReactionResponse { - return client.put("/api/v3/auth/eval-comments/$evalCommentId") { + return client.put("$API_V3/auth/eval-comments/$evalCommentId") { reaction?.let { parameter("reaction", it) } }.body() } suspend fun putRestaurantFavorite(restaurantId: Long): FavoriteResponse { - return client.put("/api/v3/auth/restaurants/$restaurantId/favorite").body() + return client.put("$API_V3/auth/restaurants/$restaurantId/favorite").body() } suspend fun deleteRestaurantFavorite(restaurantId: Long): FavoriteResponse { - return client.delete("/api/v3/auth/restaurants/$restaurantId/favorite").body() + return client.delete("$API_V3/auth/restaurants/$restaurantId/favorite").body() } suspend fun postComment( restaurantId: Long, evalId: Int, body: String, ): ReviewCommentResponse { - return client.post("/api/v3/auth/restaurants/$restaurantId/comments/$evalId") { + return client.post("$API_V3/auth/restaurants/$restaurantId/comments/$evalId") { contentType(ContentType.Application.Json) setBody(PostCommentRequest(body)) }.body() } suspend fun deleteComment( restaurantId: Long, evalCommentId: Int, ) { - client.delete("/api/v3/auth/restaurants/$restaurantId/comments/$evalCommentId").body<Unit>() + client.delete("$API_V3/auth/restaurants/$restaurantId/comments/$evalCommentId").body<Unit>() } }Also applies to: 32-34, 41-43, 50-52, 56-60, 68-71, 78-78
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@shared/data/detail/src/commonMain/kotlin/com/kus/kustaurant/detail/api/DetailApi.kt` at line 25, Extract the repeated "/api/v3" string into a single constant in the DetailApi class (e.g., a private companion object val API_PREFIX = "/api/v3") and update all client.get/post calls (the occurrences that currently use "/api/v3/..." such as the call that returns client.get("/api/v3/restaurants/$restaurantId").body()) to build paths using that constant (e.g., "$API_PREFIX/restaurants/..."); apply the same replacement for the other occurrences mentioned (lines 32-34, 41-43, 50-52, 56-60, 68-71, 78) so future version changes require changing only the constant.shared/feature/detail/src/commonMain/kotlin/com/kus/feature/detail/component/DetailRestInfo.kt (1)
172-177: 하드코딩된 문자열을 string resource로 이동 권장"제휴 정보 없음" 문자열이 하드코딩되어 있습니다. 다른 UI 문구들처럼
stringResource로 옮기어 다국어 지원 및 문구 관리 일관성을 맞추시기 바랍니다.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@shared/feature/detail/src/commonMain/kotlin/com/kus/feature/detail/component/DetailRestInfo.kt` around lines 172 - 177, The hardcoded Korean string "제휴 정보 없음" should be replaced with a string resource; update the call to DetailRestInfoMore (where content = partnershipInfo.ifBlank { "제휴 정보 없음" }) to use stringResource(R.string.<name>) inside the ifBlank fallback instead of the literal, add the corresponding entry in your strings resource file (e.g., <string name="no_partnership_info">제휴 정보 없음</string>), and import androidx.compose.ui.res.stringResource so the stringResource call resolves in DetailRestInfo.kt.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@shared/data/detail/src/commonMain/kotlin/com/kus/kustaurant/detail/api/DetailApi.kt`:
- Line 25: Extract the repeated "/api/v3" string into a single constant in the
DetailApi class (e.g., a private companion object val API_PREFIX = "/api/v3")
and update all client.get/post calls (the occurrences that currently use
"/api/v3/..." such as the call that returns
client.get("/api/v3/restaurants/$restaurantId").body()) to build paths using
that constant (e.g., "$API_PREFIX/restaurants/..."); apply the same replacement
for the other occurrences mentioned (lines 32-34, 41-43, 50-52, 56-60, 68-71,
78) so future version changes require changing only the constant.
In
`@shared/feature/detail/src/commonMain/kotlin/com/kus/feature/detail/component/DetailRestInfo.kt`:
- Around line 172-177: The hardcoded Korean string "제휴 정보 없음" should be replaced
with a string resource; update the call to DetailRestInfoMore (where content =
partnershipInfo.ifBlank { "제휴 정보 없음" }) to use stringResource(R.string.<name>)
inside the ifBlank fallback instead of the literal, add the corresponding entry
in your strings resource file (e.g., <string name="no_partnership_info">제휴 정보
없음</string>), and import androidx.compose.ui.res.stringResource so the
stringResource call resolves in DetailRestInfo.kt.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 649419da-4a62-457b-99da-530f4f59c8ec
📒 Files selected for processing (3)
shared/data/detail/src/commonMain/kotlin/com/kus/kustaurant/detail/api/DetailApi.ktshared/data/evaluate/src/commonMain/kotlin/com/kus/kustaurant/evaluate/api/EvaluateApi.ktshared/feature/detail/src/commonMain/kotlin/com/kus/feature/detail/component/DetailRestInfo.kt
개요
PR 유형
해당하는 항목에 체크해주세요.
변경 사항
📸 화면 / 영상 (선택)
Before
After
리뷰어에게 전달할 사항
Summary by CodeRabbit
릴리스 노트