-
Notifications
You must be signed in to change notification settings - Fork 3
[API] 방 검색 API 연결 및 방 시간 UI 로직 수정 #106
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
3088a51
9015bf3
d4af43e
819f7f9
9794ecf
377e531
7a3c03b
1098add
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 |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package com.texthip.thip.data.model.rooms.response | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class RoomsSearchResponse( | ||
| @SerialName("roomList") val roomList: List<SearchRoomItem> = emptyList(), | ||
| @SerialName("nextCursor") val nextCursor: String? = null, | ||
| @SerialName("isLast") val isLast: Boolean = true | ||
| ) | ||
|
|
||
| @Serializable | ||
| data class SearchRoomItem( | ||
| @SerialName("roomId") val roomId: Int = 0, | ||
| @SerialName("bookImageUrl") val bookImageUrl: String? = null, | ||
| @SerialName("roomName") val roomName: String = "", | ||
| @SerialName("memberCount") val memberCount: Int = 0, | ||
| @SerialName("recruitCount") val recruitCount: Int = 0, | ||
| @SerialName("deadlineDate") val deadlineDate: String = "", | ||
| @SerialName("isPublic") val isPublic: Boolean = true | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,9 +6,7 @@ data class GroupCardItemRoomData( | |
| val participants: Int, | ||
| val maxParticipants: Int, | ||
| val isRecruiting: Boolean, | ||
| val endDate: Int? = null, // 남은 일 수 | ||
| val endDate: String? = null, // 마감 시간 텍스트 (예: "8시간 뒤") | ||
| val imageUrl: String? = null, // API에서 받은 이미지 URL | ||
| val isSecret: Boolean = false | ||
| ) | ||
|
|
||
|
|
||
| ) | ||
|
Comment on lines
+9
to
+12
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 chainendDate의 타입 변경(Int? → String?) 일관성 좋습니다 UI 전반이 문자열 기반 마감 표기로 이행되면서 본 데이터 모델 수정이 방향성에 부합합니다. 레거시(Int) 타입이나 변환 유틸 의존이 남아있는지 확인 부탁드립니다: 🏁 Script executed: #!/bin/bash
# endDate가 Int로 선언/사용되는 곳 탐지
rg -nP -C2 '\bendDate\s*:\s*Int\??' --type=kt
# 남은 일수 계산 유틸 호출 탐지
rg -nP -C2 'getEndDateInDays|DateUtils' --type=ktLength of output: 153 endDate의 Int 타입 선언/사용 및 변환 유틸 호출 여부를 Kotlin 파일 전역에서 재검증합니다. 다음 스크립트를 실행해주세요: 🏁 Script executed: #!/bin/bash
# endDate가 Int로 선언/사용되는 곳 탐지 (Kotlin 파일)
rg -nP -C2 '\bendDate\s*:\s*Int\??' -g '*.kt'
# 남은 일수 계산 유틸 호출 탐지 (Kotlin 파일)
rg -nP -C2 'getEndDateInDays|DateUtils' -g '*.kt'Length of output: 577 endDate 변환 유틸리티 정비 필요
수정 대상:
조치:
🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,7 @@ fun GroupMyScreen( | |
| viewModel: GroupMyViewModel = hiltViewModel() | ||
| ) { | ||
| val uiState by viewModel.uiState.collectAsState() | ||
|
|
||
| GroupMyContent( | ||
| uiState = uiState, | ||
| onCardClick = onCardClick, | ||
|
|
@@ -69,7 +69,7 @@ fun GroupMyContent( | |
| onChangeRoomType: (RoomType) -> Unit = {} | ||
| ) { | ||
| val listState = rememberLazyListState() | ||
|
|
||
| // 무한 스크롤 로직 | ||
| val shouldLoadMore by remember(uiState.canLoadMore, uiState.isLoadingMore) { | ||
| derivedStateOf { | ||
|
|
@@ -78,13 +78,13 @@ fun GroupMyContent( | |
| uiState.canLoadMore && !uiState.isLoadingMore && totalItems > 0 && lastVisibleIndex >= totalItems - 3 | ||
| } | ||
| } | ||
|
|
||
| LaunchedEffect(shouldLoadMore) { | ||
| if (shouldLoadMore) { | ||
| onLoadMore() | ||
| } | ||
| } | ||
|
|
||
| // Filter 상태를 | ||
| val selectedStates = remember(uiState.currentRoomType) { | ||
| when (uiState.currentRoomType) { | ||
|
|
@@ -102,7 +102,7 @@ fun GroupMyContent( | |
| title = stringResource(R.string.my_group_room), | ||
| onLeftClick = onNavigateBack, | ||
| ) | ||
|
|
||
| PullToRefreshBox( | ||
| isRefreshing = uiState.isLoading, | ||
| onRefresh = onRefresh, | ||
|
|
@@ -138,6 +138,7 @@ fun GroupMyContent( | |
| RoomType.RECRUITING | ||
| } | ||
| } | ||
|
|
||
| else -> RoomType.PLAYING_AND_RECRUITING | ||
| } | ||
| onChangeRoomType(newRoomType) | ||
|
|
@@ -159,7 +160,7 @@ fun GroupMyContent( | |
| participants = room.memberCount, | ||
| maxParticipants = room.recruitCount, | ||
| isRecruiting = RoomUtils.isRecruitingByType(room.type), | ||
| endDate = RoomUtils.getEndDateInDays(room.endDate), | ||
| endDate = room.endDate, | ||
| imageUrl = room.bookImageUrl, | ||
| onClick = { onCardClick(room) } | ||
| ) | ||
|
Comment on lines
+163
to
166
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 chainendDate를 문자열로 직접 전달하도록 변경된 점 확인(LGTM) + 전파 영향 검증 요청 CardItemRoom의 endDate가 String?로 이관되었다면 본 변경은 타당합니다. 남은 참조 중 Int 기반(endDate: Int? 또는 변환 유틸) 사용이 없는지 전체 코드베이스 검증을 권장합니다. 다음 스크립트로 시그니처/잔존 참조를 확인해주세요: 🏁 Script executed: #!/bin/bash
# CardItemRoom의 endDate 파라미터 타입이 String?인지 확인
rg -nP -C3 'fun\s+CardItemRoom\s*\([^)]*endDate\s*:\s*String\?' --type=kt
# endDate를 Int로 사용하는 잔존 호출/정의 탐지
rg -nP -C2 '\bendDate\s*:\s*Int\??' --type=kt
# 삭제/미사용이어야 할 과거 유틸 호출 탐지
rg -nP -C2 'getEndDateInDays|DateUtils' --type=ktLength of output: 256 파일 타입 인식 에러로 🏁 Script executed: #!/bin/bash
# CardItemRoom의 endDate 파라미터 타입이 String?인지 확인
rg -nP -C3 'fun\s+CardItemRoom\s*\([^)]*endDate\s*:\s*String\?' -g '*.kt'
# endDate를 Int로 사용하는 잔존 호출/정의 탐지
rg -nP -C2 '\bendDate\s*:\s*Int\??' -g '*.kt'
# 삭제/미사용이어야 할 과거 유틸 호출 탐지
rg -nP -C2 'getEndDateInDays|DateUtils' -g '*.kt'Length of output: 653 endDate를 String?으로 이관 확인 완료, 구 변환 유틸 제거 필요 CardItemRoom의 endDate 파라미터가 정상적으로 String?로 변경되었으나, mock 데이터 클래스에 여전히 Int 변환용 유틸(
🤖 Prompt for AI Agents |
||
|
|
||
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.
String concatenation for time display formatting should be handled consistently. Consider using string formatting or a utility function to ensure proper formatting across all time displays.