Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1e5ca34
[refactor]: PR 리뷰에 맞게 레포지토리 코드 수정 (#83)
rbqks529 Aug 13, 2025
680b677
[refactor]: Group 로직을 Room으로 이동 (#83)
rbqks529 Aug 13, 2025
df1145c
[refactor]: 모집중인 모임방 장르 색 받아오게 수정 (#83)
rbqks529 Aug 13, 2025
abcd20d
[feat]: 모집중인 모임방에서 책 자세히보기 화면으로 이동 (#83)
rbqks529 Aug 13, 2025
a5ed77e
[feat]: 모임만들기 책 조회 api Response, Service 구현 (#83)
rbqks529 Aug 13, 2025
f801bf1
[feat]: 모임만들기 책 조회 api 연결 (#83)
rbqks529 Aug 13, 2025
ee4f79d
[feat]: 모임만들기 책 검색 api 연결 (#83)
rbqks529 Aug 13, 2025
35c082f
[feat]: 모임 만들기 완료 후 해당 모임방으로 이동 (#83)
rbqks529 Aug 13, 2025
fed3945
[feat]: 모집중인 모임방 베경 이미지 수정 (#83)
rbqks529 Aug 13, 2025
bf0940e
[feat]: 모집중인 모임방이 비밀방일때 비밀번호 입력 화면으로 이동 네비게이션 구현 (#83)
rbqks529 Aug 13, 2025
7053d31
[feat]: 비밀번호 입력 api dto, service, repository 구현 (#83)
rbqks529 Aug 13, 2025
ffb686d
[feat]: 모집중인 모임방 토스트 메세지 내용 수정 (#83)
rbqks529 Aug 13, 2025
5082439
[feat]: 비밀번호 입력 성공시 참여하기 로직 구현 (#83)
rbqks529 Aug 14, 2025
2715edb
[refactor]: 최근 검색어 로직 파일 이동 (#83)
rbqks529 Aug 14, 2025
f8d1492
[feat]: 방 검색 화면에 최근 검색어 로직 구현 (#83)
rbqks529 Aug 14, 2025
f3fb5cb
[feat]: 모집 마감 response, service, repository 구현 (#83)
rbqks529 Aug 14, 2025
ff68ffc
[feat]: 모집 마감 구현 및 마감 후 해당 기록장으로 이동 로직 구현 (#83)
rbqks529 Aug 14, 2025
c43d7d4
[feat]: viewModel에서 context제거 및 stringResource 추출 (#83)
rbqks529 Aug 14, 2025
8b573e9
[refactor]: util의 함수를 사용하도록 수정 (#83)
rbqks529 Aug 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions app/src/main/java/com/texthip/thip/data/di/ServiceModule.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.texthip.thip.data.di

import com.texthip.thip.data.service.BookService
import com.texthip.thip.data.service.GroupService
import com.texthip.thip.data.service.RecentSearchService
import com.texthip.thip.data.service.RoomsService
import com.texthip.thip.data.service.UserService
import dagger.Module
Expand All @@ -14,12 +14,6 @@ import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object ServiceModule {

@Provides
@Singleton
fun provideGroupService(retrofit: Retrofit): GroupService {
return retrofit.create(GroupService::class.java)
}

@Provides
@Singleton
Expand All @@ -36,4 +30,10 @@ object ServiceModule {
fun provideUserService(retrofit: Retrofit): UserService {
return retrofit.create(UserService::class.java)
}

@Provides
@Singleton
fun provideRecentSearchService(retrofit: Retrofit): RecentSearchService {
return retrofit.create(RecentSearchService::class.java)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ data class BookListResponse(

@Serializable
data class BookSavedResponse(
@SerialName("isbn") val isbn: String = "",
@SerialName("bookId") val bookId: Int = 0,
@SerialName("bookTitle") val bookTitle: String = "",
@SerialName("authorName") val authorName: String = "",
@SerialName("publisher") val publisher: String = "",
@SerialName("imageUrl") val imageUrl: String? = null
@SerialName("bookImageUrl") val bookImageUrl: String? = null,
@SerialName("isbn") val isbn: String = "",
)
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

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down
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

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down
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 RoomSecreteRoomRequest(
@SerialName("password") val password: String
)
Comment on lines +7 to +10
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

클래스/파일명 오타: Secrete → Secret. 네이밍 일관성 및 DX 영향

도메인 용어는 “Secret room”이므로 RoomSecreteRoomRequest 표기가 잘못되었습니다. 동일 오타가 서비스/레포지토리/네이게이션 전반에 전파될 수 있어 추후 검색·리팩터링 난이도가 커집니다. 요청 본문에 대한 최소 유효성 검사도 함께 추가하는 것을 권장합니다.

아래처럼 클래스명을 바로잡고, 빈 비밀번호 방지를 위한 require를 추가해주세요.

-@Serializable
-data class RoomSecreteRoomRequest(
-    @SerialName("password") val password: String
-)
+@Serializable
+data class RoomSecretRoomRequest(
+    @SerialName("password") val password: String
+) {
+    init {
+        require(password.isNotBlank()) { "password must not be blank" }
+    }
+}

후속 조치

  • 파일명도 RoomSecretRoomRequest.kt로 변경 권장.
  • 서비스 메서드(postParticipateSecreteRoom) 및 모든 호출부의 오타를 함께 정정 필요.
🤖 Prompt for AI Agents
In
app/src/main/java/com/texthip/thip/data/model/rooms/request/RoomSecreteRoomRequest.kt
around lines 7 to 10, the class and filename use the misspelling "Secrete"
instead of "Secret" and lack minimal validation; rename the class to
RoomSecretRoomRequest and move/rename the file to RoomSecretRoomRequest.kt, add
a require(password.isNotBlank()) check in the primary constructor to prevent
empty passwords, and update all impacted references (service, repository,
navigation and tests) including renaming any service method like
postParticipateSecreteRoom to postParticipateSecretRoom and fixing every call
site to match the corrected name.

Comment on lines +8 to +10
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

레포지토리 전반 ‘Secrete’ 오타 사용 여부 점검 필요

동일 오타가 퍼져 있을 가능성이 큽니다. 일괄 정정 여부를 확인해주세요.

예상 결과

  • 모든 결과가 ‘Secret’으로 교체되어야 합니다. 남아있는 경우 해당 파일들에 대한 리네임/치환을 진행해주세요.

🏁 Script executed:

#!/bin/bash
# 레포지토리 전체에서 'Secrete' 오타 사용 위치 탐색
rg -n --hidden -S 'Secrete|RoomSecreteRoomRequest|postParticipateSecreteRoom' -g '!*build*' -g '!*gradle*' -A 2

Length of output: 4311


🏁 Script executed:

#!/bin/bash
# 대소문자 무시하고 'secrete' 오타 전체 탐색
rg -n --hidden -S -i 'secrete' -g '!*build*' -g '!*gradle*' -A 2 || true

Length of output: 4262


'Secrete' 오타 일괄 교정 필요 (→ 'Secret')

레포지토리 전반에서 'Secrete' 오타가 확인되었습니다. 아래 파일/심볼을 클래스명·파일명·메서드명·임포트를 리네임하고 참조를 모두 갱신하세요. API 엔드포인트나 직렬화 키(@SerialName 등)에 영향이 있는지도 같이 확인해주세요.

수정 대상(검색으로 확인된 항목)

  • app/src/main/java/com/texthip/thip/data/model/rooms/request/RoomSecreteRoomRequest.kt
  • app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomSecreteRoomResponse.kt
  • app/src/main/java/com/texthip/thip/data/service/RoomsService.kt (import 및 suspend fun postParticipateSecreteRoom)
  • app/src/main/java/com/texthip/thip/data/repository/RoomsRepository.kt (import 및 postParticipateSecreteRoom 호출 / RoomSecreteRoomRequest 생성)
  • app/src/main/java/com/texthip/thip/ui/group/room/viewmodel/GroupRoomUnlockViewModel.kt (roomsRepository.postParticipateSecreteRoom 호출)

권장 작업

  • IDE의 안전한 리팩터(Refactor → Rename)로 클래스/파일/메서드명 일괄 변경
  • 파일명도 함께 변경하고 임포트 자동 갱신 확인
  • 변경 후 전체 검색(대소문자 무시)으로 누락된 참조 점검
  • 서버 쪽에 동일 오타가 노출돼 있다면 클라이언트·서버 동시 조치 필요
🤖 Prompt for AI Agents
In
app/src/main/java/com/texthip/thip/data/model/rooms/request/RoomSecreteRoomRequest.kt
around lines 8-10, the symbol and filename use the misspelling "Secrete" and
must be renamed to "Secret"; update the class name to RoomSecretRoomRequest,
rename the file accordingly, and then apply the same rename throughout the repo
for all listed files and symbols (RoomSecreteRoomResponse,
postParticipateSecreteRoom → postParticipateSecretRoom, imports, repository
calls, and ViewModel usages). Use your IDE’s safe Refactor→Rename to change
class/method/file names and let it update imports, then search the codebase
(case-insensitive) for any remaining "Secrete" occurrences (including
@SerialName values, API endpoints, and server-exposed strings) and correct them
to "Secret"; after changes, run a build/tests to ensure no missing references
and verify serialization keys or API contract compatibility with the server,
coordinating server changes if the typo is also exposed there.

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
Expand Down
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
Expand Down
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
Expand Down
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
Expand Down
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
Expand Down
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
Expand All @@ -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,
@SerialName("roomDescription") val roomDescription: String,
@SerialName("memberCount") val memberCount: Int,
@SerialName("recruitCount") val recruitCount: Int,
Expand Down
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 RoomSecreteRoomResponse(
@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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ package com.texthip.thip.data.repository
import com.texthip.thip.data.model.base.handleBaseResponse
import com.texthip.thip.data.model.book.request.BookSaveRequest
import com.texthip.thip.data.model.book.response.BookDetailResponse
import com.texthip.thip.data.model.book.response.BookListResponse
import com.texthip.thip.data.model.book.response.BookSaveResponse
import com.texthip.thip.data.model.book.response.BookSavedResponse
import com.texthip.thip.data.model.book.response.BookSearchResponse
import com.texthip.thip.data.model.book.response.MostSearchedBooksResponse
import com.texthip.thip.data.model.book.response.RecentSearchResponse
import com.texthip.thip.data.model.book.response.RecruitingRoomsResponse
import com.texthip.thip.data.service.BookService
import javax.inject.Inject
Expand All @@ -19,11 +18,10 @@ class BookRepository @Inject constructor(
) {

/** 저장된 책 또는 모임 책 목록 조회 */
suspend fun getBooks(type: String): Result<List<BookSavedResponse>> = runCatching {
suspend fun getBooks(type: String): Result<BookListResponse?> = runCatching {
bookService.getBooks(type)
.handleBaseResponse()
.getOrThrow()
?.bookList ?: emptyList()
}

/** 책 검색 */
Expand All @@ -40,20 +38,6 @@ class BookRepository @Inject constructor(
.getOrThrow()
}

/** 최근 검색어 조회 */
suspend fun getRecentSearches(type: String = "BOOK"): Result<RecentSearchResponse?> = runCatching {
bookService.getRecentSearches(type)
.handleBaseResponse()
.getOrThrow()
}

/** 최근 검색어 삭제 */
suspend fun deleteRecentSearch(recentSearchId: Int): Result<Unit> = runCatching {
bookService.deleteRecentSearch(recentSearchId)
.handleBaseResponse()
.getOrThrow()
}

/** 책 상세 조회 */
suspend fun getBookDetail(isbn: String): Result<BookDetailResponse?> = runCatching {
bookService.getBookDetail(isbn)
Expand Down

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
}
}
Loading