Skip to content

Commit

Permalink
refactor: 함수형 체이닝으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
CChuYong committed Nov 10, 2023
1 parent 7d71bac commit 55f012b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class CafeRoomController(
}

override fun getCafeRoom(cafeId: String, roomId: String): CafeRoomResponse {
return CafeRoomResponse.fromModel(
cafeRoomService.getRoomByRoomId(roomId)
)
return cafeRoomService.getRoomByRoomId(roomId)
.let(CafeRoomResponse::fromModel)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MeController(
userId: String,
): MeResponse {
val me = userService.getUserInfo(userId)
return MeResponse.fromModel(me)
return me.let(MeResponse::fromModel)
}

override fun getMyReviews(userId: String): List<CafeRoomReviewResponse> {
Expand All @@ -36,7 +36,7 @@ class MeController(
userId = userId,
nickname = request.nickname,
)
return MeResponse.fromModel(result)
return result.let(MeResponse::fromModel)
}

override fun updateProfileImage(
Expand All @@ -47,7 +47,7 @@ class MeController(
userId = userId,
profileImageUrl = request.profileImageUrl,
)
return MeResponse.fromModel(result)
return result.let(MeResponse::fromModel)
}

override fun quitNagaza(userId: String) {
Expand Down

0 comments on commit 55f012b

Please sign in to comment.