Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
45fa16b
[fix]: FeedScreen 오류 수정 (#65)
rbqks529 Aug 4, 2025
56ab7a9
[feat]: Hilt 주입 완료 및 기본 틀 잡기 완료 (#65)
rbqks529 Aug 4, 2025
75fedbb
[feat]: 임시 AuthInterceptor 추가 (#65)
rbqks529 Aug 4, 2025
be112fc
[feat]: 임시 AuthInterceptor 추가 (#65)
rbqks529 Aug 4, 2025
b45b079
[feat]: 참여중인 내 모임방 조회 API 연결 (#결5)
rbqks529 Aug 4, 2025
f86acc5
[feat]: 독서 모임방 DTO 추가 (#65)
rbqks529 Aug 4, 2025
3da5d89
[ui]: (#65)
rbqks529 Aug 4, 2025
67b877c
[feat]: 레포지토리 String 추출 (#65)
rbqks529 Aug 4, 2025
65284f7
[feat]: 레포지토리 String 추출 (#65)
rbqks529 Aug 4, 2025
1470a64
[feat]: 참여중인 내 모임방 페이징 처리 완료 (#65)
rbqks529 Aug 5, 2025
828801b
[feat]: GroupScreen에 refreshing 기능 추가 (#65)
rbqks529 Aug 5, 2025
4078c52
[feat]: GroupScreen에 refreshing 기능 수정 (#65)
rbqks529 Aug 5, 2025
ead0598
[feat]: 완료된 모임방 dto 추가 (#65)
rbqks529 Aug 5, 2025
cc80ac7
[feat]: 완료된 모임방 API 구현 (#65)
rbqks529 Aug 5, 2025
c8b900d
[feat]: 모집중인 모임방 dto 생성(#65)
rbqks529 Aug 5, 2025
927a90f
[feat]: 모집중인 모임방 Service, Repository구현(#65)
rbqks529 Aug 5, 2025
a0167a9
[feat]: 모집중인 모임방 API와 Screen 연결 (#65)
rbqks529 Aug 5, 2025
9307e86
[feat]: 네비게이션 수정 및 String 추출 (#65)
rbqks529 Aug 5, 2025
6ef1fb0
[feat]: GroupScreen 독서모임방 API 수정에 따른 수정 (#65)
rbqks529 Aug 5, 2025
5c4f770
[feat]: Group Room 화면 함수 삭제 (#65)
rbqks529 Aug 5, 2025
a5dc49e
[feat]: 더미 데이터용 함수 삭제 (#65)
rbqks529 Aug 5, 2025
9f6c346
[feat]: 스켈레톤 이미지를 추가한 데이터 클래스 수정 (#65)
rbqks529 Aug 5, 2025
7c5bf8e
[feat]: 토큰 변경 (#65)
rbqks529 Aug 5, 2025
574c79c
[feat]: imageRes -> imageUrl로 변경 (#65)
rbqks529 Aug 5, 2025
691ce6d
[ui]: 책선택 바텀 시트 ui 수정 (#65)
rbqks529 Aug 5, 2025
4f85a0f
[feat]: 저장된/모임 책 조회 dto 추가 (#65)
rbqks529 Aug 5, 2025
da20f63
[feat]: 저장된/모임 책 조회 서비스, 레포지토리 추가 (#65)
rbqks529 Aug 5, 2025
66ff952
[feat]: 저장된/모임 책 조회 viewModel Screen과 연결 완료 (#65)
rbqks529 Aug 5, 2025
e86901d
[feat]: 모임방 생성 DTO 추가 (#65)
rbqks529 Aug 5, 2025
b16fbd4
[feat]: 모임방 생성 서비스, 레포디토리 추가 (#65)
rbqks529 Aug 5, 2025
5929c86
[feat]: 모임방 생성 viewModel, Screen과 연결 (#65)
rbqks529 Aug 5, 2025
029ec80
[feat]: DTO 이름 변경 및 Book 관련 로직 이동 (#67)
rbqks529 Aug 6, 2025
0a9667c
[feat]: 페이징 로직 수정 (#65)
rbqks529 Aug 6, 2025
71c1e52
[feat]: 내 모임방 DTO 수정 (#65)
rbqks529 Aug 6, 2025
c22f24a
[feat]: 내 모임방(진행중, 모집중) 연결 (#65)
rbqks529 Aug 6, 2025
4dcc361
[feat]: 모집중인 모임방 DTO 수정 (#65)
rbqks529 Aug 6, 2025
5ba2364
[feat]: 내 모임방(진행중, 모집중) util함수 추가 (#65)
rbqks529 Aug 6, 2025
b50375e
[feat]: GroupRoomRecruitViewModel 으로 변경 (#65)
rbqks529 Aug 7, 2025
b184d3b
[feat]: 참여 취소를 눌렀을 때 네비게이션 및 토스트 메세지 로직 변경 (#65)
rbqks529 Aug 7, 2025
822b41e
[feat]: 모임방 참여, 취소 DTO 구현 (#65)
rbqks529 Aug 7, 2025
31279fd
[feat]: 모임방 참여, 취소 로직 연결 (#65)
rbqks529 Aug 7, 2025
d81d8c3
[refactor]: 안쓰는 StateFlow 삭제 및 장르 로직 수정 (#65)
rbqks529 Aug 7, 2025
4b3f371
[refactor]: 그룹 화면 진입시 항상 최신 데이터를 볼 수 있도록 수정 완료 (#65)
rbqks529 Aug 7, 2025
35a59a8
[chore]: 주석 정리 (#65)
rbqks529 Aug 7, 2025
1fe4947
[chore]: 주석 정리 (#65)
rbqks529 Aug 7, 2025
31374cb
[refactor]: SerialName 없는 DTO에 추가 (#65)
rbqks529 Aug 7, 2025
8b691e2
[refactor]: GroupRepository의 기능 분리(Mapper, Manager) 사용 (#65)
rbqks529 Aug 7, 2025
7bec1f8
[chore]: PR리뷰용 주석 설정 (#65)
rbqks529 Aug 7, 2025
f8b087a
[chore]: 파일 이동 (#65)
rbqks529 Aug 7, 2025
c7f1077
[chore]: Group 관련 ViewModel 및 Screen 에서 사용하는 상태 분리 (#65)
rbqks529 Aug 7, 2025
8f05f31
[refactor]: 분리한 State를 viewModel에 적용 (#65)
rbqks529 Aug 7, 2025
41246e7
[refactor]: 분리한 State를 Screen 및 네비게이션에 적용 (#65)
rbqks529 Aug 7, 2025
4f55458
[refactor]: object를 enum class로 분리 (#65)
rbqks529 Aug 7, 2025
5b0e16b
[refactor]: object를 enum class로 분리 (#65)
rbqks529 Aug 7, 2025
94ca51c
[refactor]: launchedEffect가 계속 실행되는 문제 해결
rbqks529 Aug 7, 2025
dc94a55
[refactor]: StringResource 추출 (#65)
rbqks529 Aug 7, 2025
2a1e8dd
[refactor]: 무한 스크롤 로직 개선 (#65)
rbqks529 Aug 7, 2025
b3e28e8
[refactor]: runCatching으로 레포지토리 수정 (#65)
rbqks529 Aug 7, 2025
f179552
[refactor]: UiState 파일 위치 이동 (#65)
rbqks529 Aug 7, 2025
0fc0b92
[refactor]: drawable 이름 수정 (#65)
rbqks529 Aug 7, 2025
79deb2e
[refactor]: MyRoomCardData에서 함수를 직접 구현하게 수정 (#65)
rbqks529 Aug 7, 2025
12e9c65
[refactor]: import 수정 및 기타 코드 수정 (#65)
rbqks529 Aug 7, 2025
c38559d
[refactor]: develop 코드 pull 및 충돌 해결 (#65)
rbqks529 Aug 7, 2025
4c666d1
[refactor]: PR반영 완료 (#65)
rbqks529 Aug 8, 2025
91a2b21
[refactor]: 장르 인덱스 삭제 (#65)
rbqks529 Aug 8, 2025
3bef4b6
[refactor]: Room mapper 완전히 삭제 완료 (#65)
rbqks529 Aug 9, 2025
888d7d8
[refactor]: genreManager에서 enum class를 사용하게 수정 완료 (#65)
rbqks529 Aug 9, 2025
5a5a340
[refactor]: screen을 content와 분리 완료 (#65)
rbqks529 Aug 9, 2025
e05e425
[refactor]: 장르 매핑 오류 해결 (#65)
rbqks529 Aug 9, 2025
347b21a
Merge branch 'develop' into feat/#65_API_Rooms_Recruiting
rbqks529 Aug 9, 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: 14 additions & 0 deletions app/src/main/java/com/texthip/thip/data/di/ServiceModule.kt
Original file line number Diff line number Diff line change
@@ -1,5 +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.RoomsService
import dagger.Module
import dagger.Provides
Expand All @@ -11,6 +13,18 @@ import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object ServiceModule {

@Provides
@Singleton
fun provideGroupService(retrofit: Retrofit): GroupService {
return retrofit.create(GroupService::class.java)
}
Comment on lines +19 to +21
Copy link
Member

Choose a reason for hiding this comment

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

ㅎㅎㅋㅋㅎㅎㅋㅎㅋ아놔 저는 이거 RoomsService로 했는데 .. 합쳐야겠네여 ..

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

오히려 좋을지도... 충돌은 안날거 같네요


@Provides
@Singleton
fun provideBookService(retrofit: Retrofit): BookService {
return retrofit.create(BookService::class.java)
}
@Provides
@Singleton
fun providesRoomsService(retrofit: Retrofit): RoomsService =
Expand Down

This file was deleted.

24 changes: 24 additions & 0 deletions app/src/main/java/com/texthip/thip/data/manager/Genre.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.texthip.thip.data.manager

/**
* 도서 장르를 나타내는 enum class
*/
enum class Genre(
val displayKey: String,
val apiCategory: String,
val networkApiCategory: String = apiCategory
) {
LITERATURE("literature", "문학"),
SCIENCE_IT("science_it", "과학·IT", "과학/IT"),
SOCIAL_SCIENCE("social_science", "사회과학"),
HUMANITIES("humanities", "인문학"),
ART("art", "예술");

companion object {
fun getDefault() = LITERATURE

fun fromDisplayKey(displayKey: String): Genre? {
return entries.find { it.displayKey == displayKey }
}
}
}
24 changes: 24 additions & 0 deletions app/src/main/java/com/texthip/thip/data/manager/GenreManager.kt
Copy link
Member

Choose a reason for hiding this comment

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

흠 .. 저는 장르를 enum으로 관리했는데 이방법도 좋아보이네여 .. 어떤 방식으로 통일하는게 좋을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

이게 장르를 관리하는 코드긴한데 "과학·IT" -> "과학/IT" 이거 처리하려고 만든 코드인데 겸사겸사 장르까지 관리하려고 헀습니다

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.texthip.thip.data.manager

import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class GenreManager @Inject constructor() {

fun getGenres(): List<Genre> {
return Genre.entries
}

fun mapGenreToApiCategory(genre: Genre): String {
return genre.networkApiCategory
}

fun getDefaultGenre(): Genre {
return Genre.getDefault()
}

fun getGenreByDisplayKey(displayKey: String): Genre? {
return Genre.fromDisplayKey(displayKey)
}
}
19 changes: 19 additions & 0 deletions app/src/main/java/com/texthip/thip/data/manager/UserDataManager.kt
Copy link
Member

Choose a reason for hiding this comment

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

이건 사용자의 닉네임을 캐싱해두기 위한 코드인가여? 서버에서 닉네임을 보내주는걸로 알고있는데 조금 더 빨리 로딩하기 위해서 만든 코드인가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

닉네임을 보내주는 API도 있고 안보내주는 API도 있어서 한번 받으면 캐싱해두고 사용하려고 했습니다!

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.texthip.thip.data.manager

import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class UserDataManager @Inject constructor() {

private var cachedUserName: String? = null

fun getUserName(): String {
return cachedUserName ?: "사용자"
}

fun cacheUserName(name: String) {
cachedUserName = name
}
Comment on lines +15 to +17
Copy link
Member

Choose a reason for hiding this comment

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

오옹 캐싱 처리도 해주셨네용 👍👍
앱을 종료하기 전까지만 유저네임을 보존하고 앱을 종료하면 휘발되게끔 하려는 목적이 맞으신가요? 전 좋은 것 같습니당


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.texthip.thip.data.model.book.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable


@Serializable
data class BookListResponse(
@SerialName("bookList") val bookList: List<BookSavedResponse>
)

@Serializable
data class BookSavedResponse(
@SerialName("isbn") val isbn: String,
@SerialName("bookTitle") val bookTitle: String,
@SerialName("authorName") val authorName: String,
@SerialName("publisher") val publisher: String,
@SerialName("imageUrl") val imageUrl: String?
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.texthip.thip.data.model.group.request

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class CreateRoomRequest(
@SerialName("isbn") val isbn: String,
@SerialName("category") val category: String,
@SerialName("roomName") val roomName: String,
@SerialName("description") val description: String,
@SerialName("progressStartDate") val progressStartDate: String,
@SerialName("progressEndDate") val progressEndDate: String,
@SerialName("recruitCount") val recruitCount: Int,
@SerialName("password") val password: String? = null,
@SerialName("isPublic") val isPublic: Boolean
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.texthip.thip.data.model.group.request

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class RoomJoinRequest(
@SerialName("type") val type: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.texthip.thip.data.model.group.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class CreateRoomResponse(
@SerialName("roomId") val roomId: Int
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.texthip.thip.data.model.group.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable


@Serializable
data class JoinedRoomListResponse(
@SerialName("roomList") val roomList: List<JoinedRoomResponse>,
@SerialName("nickname") val nickname: String,
@SerialName("page") val page: Int,
@SerialName("size") val size: Int,
@SerialName("last") val last: Boolean,
@SerialName("first") val first: Boolean
)

@Serializable
data class JoinedRoomResponse(
@SerialName("roomId") val roomId: Int,
@SerialName("bookImageUrl") val bookImageUrl: String?,
@SerialName("bookTitle") val bookTitle: String,
@SerialName("memberCount") val memberCount: Int,
@SerialName("userPercentage") val userPercentage: Int
)

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.texthip.thip.data.model.group.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class MyRoomListResponse(
@SerialName("roomList") val roomList: List<MyRoomResponse>,
@SerialName("nextCursor") val nextCursor: String?,
@SerialName("isLast") val isLast: Boolean
)

@Serializable
data class MyRoomResponse(
@SerialName("roomId") val roomId: Int,
@SerialName("bookImageUrl") val bookImageUrl: String,
@SerialName("roomName") val roomName: String,
@SerialName("recruitCount") val recruitCount: Int,
@SerialName("memberCount") val memberCount: Int,
@SerialName("endDate") val endDate: String,
@SerialName("type") val type: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.texthip.thip.data.model.group.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class RoomJoinResponse(
@SerialName("roomId") val roomId: Int,
@SerialName("type") val type: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.texthip.thip.data.model.group.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable


@Serializable
data class RoomMainResponse(
@SerialName("roomId") val roomId: Int,
@SerialName("bookImageUrl") val bookImageUrl: String?,
@SerialName("roomName") val roomName: String,
@SerialName("recruitCount") val recruitCount: Int,
@SerialName("memberCount") val memberCount: Int,
@SerialName("deadlineDate") val deadlineDate: String
)

@Serializable
data class RoomMainList(
@SerialName("deadlineRoomList") val deadlineRoomList: List<RoomMainResponse> = emptyList(),
@SerialName("popularRoomList") val popularRoomList: List<RoomMainResponse> = emptyList()
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.texthip.thip.data.model.group.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class RoomRecruitingResponse(
@SerialName("isHost") val isHost: Boolean,
@SerialName("isJoining") val isJoining: Boolean,
@SerialName("roomId") val roomId: Int,
@SerialName("roomName") val roomName: String,
@SerialName("roomImageUrl") val roomImageUrl: String?,
@SerialName("isPublic") val isPublic: Boolean,
@SerialName("progressStartDate") val progressStartDate: String,
@SerialName("progressEndDate") val progressEndDate: String,
@SerialName("recruitEndDate") val recruitEndDate: String,
@SerialName("category") val category: String,
@SerialName("roomDescription") val roomDescription: String,
@SerialName("memberCount") val memberCount: Int,
@SerialName("recruitCount") val recruitCount: Int,
@SerialName("isbn") val isbn: String,
@SerialName("bookImageUrl") val bookImageUrl: String,
@SerialName("bookTitle") val bookTitle: String,
@SerialName("authorName") val authorName: String,
@SerialName("bookDescription") val bookDescription: String,
@SerialName("publisher") val publisher: String,
@SerialName("recommendRooms") val recommendRooms: List<RecommendRoomResponse>
)

@Serializable
data class RecommendRoomResponse(
@SerialName("roomId") val roomId: Int,
@SerialName("roomImageUrl") val roomImageUrl: String?,
@SerialName("roomName") val roomName: String,
@SerialName("memberCount") val memberCount: Int,
@SerialName("recruitCount") val recruitCount: Int,
@SerialName("recruitEndDate") val recruitEndDate: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.texthip.thip.data.repository

import com.texthip.thip.data.model.base.handleBaseResponse
import com.texthip.thip.data.service.BookService
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class BookRepository @Inject constructor(
private val bookService: BookService
) {

/** 저장된 책 또는 모임 책 목록 조회 */
suspend fun getBooks(type: String) = runCatching {
bookService.getBooks(type)
.handleBaseResponse()
.getOrThrow()
?.bookList ?: emptyList()
}
}
Copy link
Member

Choose a reason for hiding this comment

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

우왓 .. 코드가 완전 복잡하네요 ..! 제가 평소에 작성하던 repository랑은 다른 감이 있는데 Mapper가 추가돼서 그런걸까요 ..!? 데이터가 없는 경우를 하나하나 생각해서 작업한건가요 ..!? 코드의 전반적인 로직이 궁금합니두

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

비슷해요 요청하고 BaseResponse처리하고 성공하면 데이터 처리하는건데 Mapper랑 Manager 코드가 들어가서 매핑하는 로직이 추가되서 좀 복잡해 보이는겁니다! 일단 runCatchint으로 수정할게요

Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package com.texthip.thip.data.repository

import com.texthip.thip.data.manager.GenreManager
import com.texthip.thip.data.manager.UserDataManager
import com.texthip.thip.data.manager.Genre
import com.texthip.thip.data.model.base.handleBaseResponse
import com.texthip.thip.data.model.group.request.CreateRoomRequest
import com.texthip.thip.data.model.group.request.RoomJoinRequest
import com.texthip.thip.data.model.group.response.JoinedRoomListResponse
import com.texthip.thip.data.model.group.response.MyRoomListResponse
import com.texthip.thip.data.model.group.response.RoomMainList
import com.texthip.thip.data.model.group.response.RoomRecruitingResponse
import com.texthip.thip.data.service.GroupService
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class GroupRepository @Inject constructor(
private val groupService: GroupService,
private val genreManager: GenreManager,
private val userDataManager: UserDataManager
) {

/** 장르 목록 조회 */
fun getGenres(): Result<List<Genre>> {
return Result.success(genreManager.getGenres())
}

/** 사용자 이름 조회(캐싱 데이터 사용)*/
fun getUserName(): Result<String> {
return Result.success(userDataManager.getUserName())
}

/** 내가 참여 중인 모임방 목록 조회 */
suspend fun getMyJoinedRooms(page: Int): Result<JoinedRoomListResponse?> = runCatching {
val response = groupService.getJoinedRooms(page)
.handleBaseResponse()
.getOrThrow()

response?.let { joinedRoomsDto ->
userDataManager.cacheUserName(joinedRoomsDto.nickname)
}

response
}

/** 카테고리별 모임방 섹션 조회 (마감임박/인기) */
suspend fun getRoomSections(genre: Genre? = null): Result<RoomMainList?> = runCatching {
val selectedGenre = genre ?: genreManager.getDefaultGenre()
val apiCategory = genreManager.mapGenreToApiCategory(selectedGenre)

groupService.getRooms(apiCategory)
.handleBaseResponse()
.getOrThrow()
}

/** 타입별 내 모임방 목록 조회 */
suspend fun getMyRoomsByType(type: String?, cursor: String? = null): Result<MyRoomListResponse?> = runCatching {
groupService.getMyRooms(type, cursor)
.handleBaseResponse()
.getOrThrow()
}

/** 모집중인 모임방 상세 정보 조회 */
suspend fun getRoomRecruiting(roomId: Int): Result<RoomRecruitingResponse> = runCatching {
groupService.getRoomRecruiting(roomId)
.handleBaseResponse()
.getOrThrow()!!
}
Comment on lines +65 to +69
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

널 가능성 방어 코드 필요

getOrThrow()!! 후 강제 언래핑은 서버가 null을 반환할 경우 NPE를 유발합니다. ?: return Result.failure(...) 형태로 안전하게 처리해 주세요.

🤖 Prompt for AI Agents
In app/src/main/java/com/texthip/thip/data/repository/GroupRepository.kt around
lines 65 to 69, the code force unwraps a nullable value with `getOrThrow()!!`,
which can cause a NullPointerException if the server returns null. Modify the
code to safely handle null by using the Elvis operator `?:` to return a
`Result.failure(...)` when the value is null instead of force unwrapping.


/** 새 모임방 생성 */
suspend fun createRoom(request: CreateRoomRequest): Result<Int> = runCatching {
groupService.createRoom(request)
.handleBaseResponse()
.getOrThrow()!!
.roomId
}

/** 모임방 참여 또는 취소 */
suspend fun joinOrCancelRoom(roomId: Int, type: String): Result<String> = runCatching {
val request = RoomJoinRequest(type = type)
groupService.joinOrCancelRoom(roomId, request)
.handleBaseResponse()
.getOrThrow()!!
.type
}
}
Loading