-
Notifications
You must be signed in to change notification settings - Fork 3
[API] Rooms 나머지 API 연결 #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1e5ca34
680b677
df1145c
abcd20d
a5ed77e
f801bf1
ee4f79d
35c082f
fed3945
bf0940e
7053d31
ffb686d
5082439
2715edb
f8d1492
f3fb5cb
ff68ffc
c43d7d4
8b573e9
5fa32b1
320f40e
a088ac7
a7074a4
c0903af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package com.texthip.thip.data.model.group.request | ||
| package com.texthip.thip.data.model.rooms.request | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain허용값(Join 타입) 사용 현황 점검 요청 코드 내 하드코딩된 문자열이 있는지 빠르게 확인해 enum 전환 난이도를 파악하면 좋겠습니다. 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Join/CANCEL/LEAVE 등 조인 관련 상수 후보 검색"
rg -n --hidden --glob '!.git' -e '"JOIN"' -e '"CANCEL"' -e '"LEAVE"' -e '"REQUEST"'Length of output: 184 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "1) 대문자 토큰(JOIN/CANCEL/LEAVE/REQUEST) 단어 경계 검색 (대소문자 무시)"
rg -n --hidden --glob '!.git' -S -i -e '\b(JOIN|CANCEL|LEAVE|REQUEST)\b' -g '!**/build/**' -g '!**/node_modules/**' -A2 -B2 || true
echo
echo "2) 큰따옴표로 감싼 토큰(\"JOIN\" 등) 검색"
rg -n --hidden --glob '!.git' -S -i -e '"(JOIN|CANCEL|LEAVE|REQUEST)"' -g '!**/build/**' -g '!**/node_modules/**' -A2 -B2 || true
echo
echo "3) 소문자 포함 일반 토큰(join/cancel/leave/request) 검색"
rg -n --hidden --glob '!.git' -S -i -e '\b(join|cancel|leave|request)\b' -g '!**/build/**' -g '!**/node_modules/**' -A2 -B2 || true
echo
echo "4) enum class .*Join 형태 검색"
rg -n --hidden --glob '!.git' -S -i -e 'enum class .*Join' -g '!**/build/**' -g '!**/node_modules/**' -A2 -B2 || true
echo
echo "5) JoinType/JoinStatus/JoinRequest 등 관련 식별자 검색"
rg -n --hidden --glob '!.git' -S -i -e 'Join(Type|Status|Action|Request)?' -g '!**/build/**' -g '!**/node_modules/**' -A2 -B2 || true
echo
echo "6) 파일 경로에 'join' 포함된 파일 목록(대소문자 무시)"
rg --files --hidden -g '!.git' -g '!**/build/**' -g '!**/node_modules/**' | rg -i '/.*join.*' || trueLength of output: 140317 허용값(Join 타입) enum 전환 검토 — 사용처 확인 결과 간단 요약: 레포 전체 검색 결과, API 요청/저장소는 문자열 타입을 사용하고 있고 UI에만 지역 enum(RoomAction)이 존재합니다. 중앙화된 enum(예: JoinType/RoomActionType)으로 정리하는 것이 안전합니다. 주의가 필요한 파일(발견된 위치)
권장 작업(간단)
위 파일들을 중심으로 수정하면 enum 전환 난이도가 낮고 영향 범위를 관리하기 쉬울 것으로 보입니다. 상세 변경안 원하시면 간단한 코드 예시(enum 정의 + Request/Repository 변환)를 드리겠습니다. |
||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package com.texthip.thip.data.model.rooms.request | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
|
|
||
| @Serializable | ||
| data class RoomSecretRoomRequest( | ||
| @SerialName("password") val password: String | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.texthip.thip.data.model.rooms.response | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class RoomCloseResponse( | ||
| @SerialName("roomId") val roomId: Int | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package com.texthip.thip.data.model.group.response | ||
| package com.texthip.thip.data.model.rooms.response | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
@@ -15,6 +15,7 @@ data class RoomRecruitingResponse( | |
| @SerialName("progressEndDate") val progressEndDate: String, | ||
| @SerialName("recruitEndDate") val recruitEndDate: String, | ||
| @SerialName("category") val category: String, | ||
| @SerialName("categoryColor") val categoryColor: String, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain새 필드(categoryColor) 추가 — 역직렬화 실패 가능성 점검 필요 필드가 non-null이고 기본값이 없어, 백엔드에서 누락 시 kotlinx.serialization 디코딩이 실패할 수 있습니다. 스키마 보장이 명확하지 않다면 nullable + 기본값 또는 안전한 기본값을 권장합니다. 적용 제안(diff): - @SerialName("categoryColor") val categoryColor: String,
+ @SerialName("categoryColor") val categoryColor: String? = null,검증 스크립트: categoryColor 사용처가 null/빈 문자열에 대해 안전하게 처리되는지 확인 🏁 Script executed: #!/bin/bash
# categoryColor 사용처 점검
rg -n --no-heading "categoryColor"
# 색 변환 유틸이 존재한다면 함께 확인(예: hexToColor)
rg -n --no-heading "hexToColor|colorFromHex|toColor"Length of output: 1619 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== RoomRecruitingResponse.kt ==="
nl -ba app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomRecruitingResponse.kt | sed -n '1,200p' || true
echo
echo "=== HexToColor.kt ==="
nl -ba app/src/main/java/com/texthip/thip/utils/color/HexToColor.kt | sed -n '1,200p' || true
echo
echo "=== GroupRoomRecruitScreen.kt (1-420) ==="
nl -ba app/src/main/java/com/texthip/thip/ui/group/room/screen/GroupRoomRecruitScreen.kt | sed -n '1,420p' || true
echo
echo "=== GroupRoomRecruitScreen.kt (420-620) ==="
nl -ba app/src/main/java/com/texthip/thip/ui/group/room/screen/GroupRoomRecruitScreen.kt | sed -n '420,620p' || true
echo
echo "=== GroupRoomHeader.kt ==="
nl -ba app/src/main/java/com/texthip/thip/ui/group/room/component/GroupRoomHeader.kt | sed -n '1,240p' || true
echo
echo "=== GenreColor/related color utilities search ==="
rg -n --no-heading "GenreColor|colorProvider|fromString" || trueLength of output: 2602 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== RoomRecruitingResponse.kt ==="
sed -n '1,200p' app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomRecruitingResponse.kt || true
echo
echo "=== HexToColor.kt ==="
sed -n '1,200p' app/src/main/java/com/texthip/thip/utils/color/HexToColor.kt || true
echo
echo "=== GroupRoomRecruitScreen.kt (330-380) ==="
sed -n '330,380p' app/src/main/java/com/texthip/thip/ui/group/room/screen/GroupRoomRecruitScreen.kt || true
echo
echo "=== GroupRoomRecruitScreen.kt (500-520) ==="
sed -n '500,520p' app/src/main/java/com/texthip/thip/ui/group/room/screen/GroupRoomRecruitScreen.kt || true
echo
echo "=== GroupRoomHeader.kt (1-120) ==="
sed -n '1,120p' app/src/main/java/com/texthip/thip/ui/group/room/component/GroupRoomHeader.kt || true
echo
echo "=== GenreColor.kt ==="
sed -n '1,240p' app/src/main/java/com/texthip/thip/utils/type/GenreColor.kt || trueLength of output: 11458 categoryColor: 서버 누락 대비 — 모델을 nullable로 바꾸고 사용처를 null-safe 처리하세요 RoomRecruitingResponse의 categoryColor가 non-null(String)으로 정의되어 있어 백엔드가 필드를 보내지 않으면 kotlinx.serialization에서 디코딩이 실패합니다. 또한 GroupRoomRecruitScreen.kt에서 hexToColor(detail.categoryColor)를 바로 호출하고 있어 null 허용으로 변경 시 사용처도 수정해야 합니다. (참고: hexToColor는 잘못된 포맷일 경우 Color.White로 안전하게 폴백합니다.) 수정이 필요한 위치:
권장 변경(diff): --- a/app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomRecruitingResponse.kt
@@
- @SerialName("categoryColor") val categoryColor: String,
+ @SerialName("categoryColor") val categoryColor: String? = null,--- a/app/src/main/java/com/texthip/thip/ui/group/room/screen/GroupRoomRecruitScreen.kt
@@
- Text(
- text = detail.category,
- style = typography.info_m500_s12,
- color = hexToColor(detail.categoryColor)
- )
+ Text(
+ text = detail.category,
+ style = typography.info_m500_s12,
+ color = detail.categoryColor?.let { hexToColor(it) } ?: colors.White
+ )
|
||
| @SerialName("roomDescription") val roomDescription: String, | ||
| @SerialName("memberCount") val memberCount: Int, | ||
| @SerialName("recruitCount") val recruitCount: Int, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package com.texthip.thip.data.model.rooms.response | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
|
|
||
| @Serializable | ||
| data class RoomSecretRoomResponse( | ||
| @SerialName("matched") val matched: Boolean = false, | ||
| @SerialName("roomId") val roomId: Int = 0 | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package com.texthip.thip.data.provider | ||
|
|
||
| import android.content.Context | ||
| import androidx.annotation.StringRes | ||
| import dagger.hilt.android.qualifiers.ApplicationContext | ||
| import javax.inject.Inject | ||
| import javax.inject.Singleton | ||
|
|
||
| @Singleton | ||
| class StringResourceProvider @Inject constructor( | ||
| @param:ApplicationContext private val context: Context | ||
| ) { | ||
|
|
||
| fun getString(@StringRes resId: Int): String { | ||
| return context.getString(resId) | ||
| } | ||
|
|
||
| fun getString(@StringRes resId: Int, vararg formatArgs: Any): String { | ||
| return context.getString(resId, *formatArgs) | ||
| } | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package com.texthip.thip.data.repository | ||
|
|
||
| import com.texthip.thip.data.model.base.handleBaseResponse | ||
| import com.texthip.thip.data.model.book.response.RecentSearchResponse | ||
| import com.texthip.thip.data.service.RecentSearchService | ||
| import javax.inject.Inject | ||
| import javax.inject.Singleton | ||
|
|
||
| @Singleton | ||
| class RecentSearchRepository @Inject constructor( | ||
| private val recentSearchService: RecentSearchService | ||
| ) { | ||
|
|
||
| /** 최근 검색어 조회 */ | ||
| suspend fun getRecentSearches(type: String): Result<RecentSearchResponse?> = runCatching { | ||
| recentSearchService.getRecentSearches(type) | ||
| .handleBaseResponse() | ||
| .getOrThrow() | ||
| } | ||
|
|
||
| /** 최근 검색어 삭제 */ | ||
| suspend fun deleteRecentSearch(recentSearchId: Int): Result<Unit> = runCatching { | ||
| recentSearchService.deleteRecentSearch(recentSearchId) | ||
| .handleBaseResponse() | ||
| .getOrThrow() | ||
| ?: Unit | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
BookSavedResponse 스키마 변경 — 호출부/백엔드 정합성 확인 필요
다음 점검을 권장합니다.
검증 스크립트:
🏁 Script executed:
Length of output: 2835
BookSavedResponse 스키마 변경 — imageUrl 미마이그레이션 다수 발견, bookId(0) 처리 검토 필요
검증 요약: 실행한 grep 결과 다수 파일에서 여전히 .imageUrl을 참조하고 있어 필드명 변경(bookImageUrl) 마이그레이션이 완료되지 않았습니다. bookId는 선언부(app/src/main/java/com/texthip/thip/data/model/book/response/BookListResponse.kt:14) 외에 검색되지 않았으나, 기본값 0을 유효 ID로 오인하는 로직이 없는지 확인이 필요합니다.
수정이 필요한 호출부(발견된 주요 파일)
권장 조치 (간단)
🤖 Prompt for AI Agents