-
Notifications
You must be signed in to change notification settings - Fork 7
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
實作取得房間資訊 #124
實作取得房間資訊 #124
Conversation
application/src/main/kotlin/tw/waterballsa/gaas/application/usecases/GetRoomUsecase.kt
Outdated
Show resolved
Hide resolved
with(request) { | ||
val room = findRoomById(Room.Id(roomId))!! | ||
room.validatePlayerInRoom(Player.Id(userId)) | ||
room.also { presenter.present(it) } |
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.
這邊可以直接 presenter.present(room)
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.
Review done.
application/src/main/kotlin/tw/waterballsa/gaas/application/usecases/GetRoomUsecase.kt
Outdated
Show resolved
Hide resolved
application/src/main/kotlin/tw/waterballsa/gaas/application/usecases/GetRoomUsecase.kt
Outdated
Show resolved
Hide resolved
spring/src/main/kotlin/tw/waterballsa/gaas/spring/controllers/presenter/GetRoomPresenter.kt
Outdated
Show resolved
Hide resolved
spring/src/main/kotlin/tw/waterballsa/gaas/spring/controllers/presenter/GetRoomPresenter.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/RoomControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/RoomControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/RoomControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/RoomControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/RoomControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/RoomControllerTest.kt
Outdated
Show resolved
Hide resolved
236c8c0
to
588ac54
Compare
|
||
private fun Room.validatePlayerInRoom(playerId: Player.Id) { | ||
if (!hasPlayer(playerId)) { | ||
throw PlatformException("Player(" + playerId!!.value + ") is not in the room(" + roomId!!.value + ").") |
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 interpolate
val host = createUser("2", "[email protected]", "winner1122").toRoomPlayer() | ||
givenHostAndPlayersJoinedTheRoom(host) | ||
.whenUserGetTheRoom(userA) | ||
.thenShouldFail("Player(" + userA.id!!.value + ") is not in the room(" + testRoom.roomId!!.value + ").") |
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.
ditto
使用 String interpolate
588ac54
to
2503358
Compare
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.
Review done.
application/src/main/kotlin/tw/waterballsa/gaas/application/usecases/GetRoomUsecase.kt
Outdated
Show resolved
Hide resolved
application/src/main/kotlin/tw/waterballsa/gaas/application/usecases/GetRoomUsecase.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/RoomControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/RoomControllerTest.kt
Outdated
Show resolved
Hide resolved
2503358
to
54999f7
Compare
54999f7
to
e4f960a
Compare
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.
LGTM
依據jwt subject is user identity修正 根據第三次 code review 修正 根據第二次 code review 修正 根據第一次 code review 修正 實作取得房間資訊
e4f960a
to
5d31a08
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Why need this change? / Root cause:
Changes made:
Test Scope / Change impact:
Issue
GET /rooms/{roomId}
取得房間資訊 #64