diff --git a/src/main/kotlin/kr/nagaza/nagazaserver/presenter/restapi/controller/CafeRoomController.kt b/src/main/kotlin/kr/nagaza/nagazaserver/presenter/restapi/controller/CafeRoomController.kt index 098d6b2..137ee48 100644 --- a/src/main/kotlin/kr/nagaza/nagazaserver/presenter/restapi/controller/CafeRoomController.kt +++ b/src/main/kotlin/kr/nagaza/nagazaserver/presenter/restapi/controller/CafeRoomController.kt @@ -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) } } diff --git a/src/main/kotlin/kr/nagaza/nagazaserver/presenter/restapi/controller/MeController.kt b/src/main/kotlin/kr/nagaza/nagazaserver/presenter/restapi/controller/MeController.kt index 2f827d8..aec7e0f 100644 --- a/src/main/kotlin/kr/nagaza/nagazaserver/presenter/restapi/controller/MeController.kt +++ b/src/main/kotlin/kr/nagaza/nagazaserver/presenter/restapi/controller/MeController.kt @@ -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 { @@ -36,7 +36,7 @@ class MeController( userId = userId, nickname = request.nickname, ) - return MeResponse.fromModel(result) + return result.let(MeResponse::fromModel) } override fun updateProfileImage( @@ -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) {