-
Notifications
You must be signed in to change notification settings - Fork 3
[feat] 게임 방 전체 목록 조회 api 구현 #16
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6dacd0c
:wrench: chore: Quiz, User에 @Getter 및 임시 @Setter 추가
LimKangHyun a3bad3f
chore: Java 스타일 수정
de06a61
:sparkles: feat: 룸 목록 조회 응답 DTO(RoomListResponse) 추가
LimKangHyun 59d623e
Merge remote-tracking branch 'origin/feat/14' into feat/14
LimKangHyun 054810a
chore: Java 스타일 수정
75f755c
:sparkles: feat: 룸 전체 조회 API 구현
LimKangHyun 2d98cbc
chore: Java 스타일 수정
2b34689
:white_check_mark: test: 룸 전체 조회 리포지토리 테스트 추가
LimKangHyun a1d31ee
chore: Java 스타일 수정
34f7758
:recycle: 리뷰 반영 수정
LimKangHyun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
backend/src/main/java/io/f1/backend/domain/game/dto/response/RoomListResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package io.f1.backend.domain.game.dto.response; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public record RoomListResponse(List<RoomResponse> rooms) {} |
14 changes: 14 additions & 0 deletions
14
backend/src/main/java/io/f1/backend/domain/game/dto/response/RoomResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package io.f1.backend.domain.game.dto.response; | ||
|
|
||
| public record RoomResponse( | ||
| Long roomId, | ||
| String roomName, | ||
| int maxUserCount, | ||
| int currentUserCount, | ||
| boolean locked, | ||
| String roomState, | ||
| String quizTitle, | ||
| String description, | ||
| String creator, | ||
| int numberOfQuestions, | ||
| String thumbnailUrl) {} |
18 changes: 18 additions & 0 deletions
18
backend/src/main/java/io/f1/backend/domain/game/mapper/RoomMapper.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,30 @@ | ||
| package io.f1.backend.domain.game.mapper; | ||
|
|
||
| import io.f1.backend.domain.game.dto.request.RoomCreateRequest; | ||
| import io.f1.backend.domain.game.dto.response.RoomResponse; | ||
| import io.f1.backend.domain.game.model.Room; | ||
| import io.f1.backend.domain.game.model.RoomSetting; | ||
| import io.f1.backend.domain.quiz.entity.Quiz; | ||
|
|
||
| public class RoomMapper { | ||
|
|
||
| public static RoomSetting toRoomSetting(RoomCreateRequest request) { | ||
| return new RoomSetting( | ||
| request.roomName(), request.maxUserCount(), request.locked(), request.password()); | ||
| } | ||
|
|
||
| public static RoomResponse toRoomResponse(Room room, Quiz quiz) { | ||
| return new RoomResponse( | ||
| room.getId(), | ||
| room.getRoomSetting().roomName(), | ||
| room.getRoomSetting().maxUserCount(), | ||
| room.getPlayerSessionMap().size(), | ||
| room.getRoomSetting().locked(), | ||
| room.getState().name(), | ||
| quiz.getTitle(), | ||
| quiz.getDescription(), | ||
| quiz.getCreator().getNickname(), | ||
| quiz.getQuestions().size(), | ||
| quiz.getThumbnailUrl()); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
[L4-변경제안]
transactional readonly를 명시하면 좋다고 생각합니다 !
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.
인메모리 리포지토리라 트랜잭션이 실질적으로 동작하진 않지만, 의도 전달 목적으로 명시하는 걸 말씀하시는 걸까요?
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.
아 인메모리 레포지토리란걸 잊고 있었네요. 수정 없이 이대로 하시면 될 것 같습니다 !