-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: 방 전체 목록 조회 기능 구현 #109
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
71ae355
Merge branch 'develop' into feature/#106-search-all-rooms
ymkim97 3b28b7c
feat: 방 전체 목록 조회 컨트롤러 추가
ymkim97 9acb1e3
refactor: 방장 member 반환 기능 삭제
ymkim97 47686c4
feat: 방 검색 dto 추가
ymkim97 dc4e040
feat: 방 전체 조회 기능 구현
ymkim97 7a47230
fix: 서비스, 컨트롤러 수정
ymkim97 962c510
test: 서비스 단위 테스트 작성
ymkim97 0d3eac0
test: 통합 테스트 작성
ymkim97 ed08bca
fix: 피연산자 Long으로 수정
ymkim97 49faec7
Merge branch 'develop' into feature/#106-search-all-rooms
ymkim97 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 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 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 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 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
33 changes: 0 additions & 33 deletions
33
src/main/java/com/moabam/api/domain/member/repository/MemberSearchRepository.java
This file was deleted.
Oops, something went wrong.
This file contains 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
33 changes: 33 additions & 0 deletions
33
src/main/java/com/moabam/api/domain/room/repository/RoomSearchRepository.java
This file contains 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,33 @@ | ||
package com.moabam.api.domain.room.repository; | ||
|
||
import static com.moabam.api.domain.room.QRoom.*; | ||
import static com.moabam.global.common.util.GlobalConstant.*; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.stereotype.Repository; | ||
|
||
import com.moabam.api.domain.room.Room; | ||
import com.moabam.api.domain.room.RoomType; | ||
import com.moabam.global.common.util.DynamicQuery; | ||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@Repository | ||
@RequiredArgsConstructor | ||
public class RoomSearchRepository { | ||
|
||
private final JPAQueryFactory jpaQueryFactory; | ||
|
||
public List<Room> findAllWithNoOffset(RoomType roomType, Long roomId) { | ||
return jpaQueryFactory.selectFrom(room) | ||
.where( | ||
DynamicQuery.generateEq(roomType, room.roomType::eq), | ||
DynamicQuery.generateEq(roomId, room.id::lt) | ||
) | ||
.orderBy(room.id.desc()) | ||
.limit(ROOM_FIXED_SEARCH_SIZE + 1L) | ||
.fetch(); | ||
} | ||
} |
This file contains 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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/moabam/api/dto/room/SearchAllRoomResponse.java
This file contains 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,24 @@ | ||
package com.moabam.api.dto.room; | ||
|
||
import java.util.List; | ||
|
||
import com.moabam.api.domain.room.RoomType; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record SearchAllRoomResponse( | ||
Long id, | ||
String title, | ||
String image, | ||
boolean isPassword, | ||
String managerNickname, | ||
int level, | ||
RoomType roomType, | ||
int certifyTime, | ||
int currentUserCount, | ||
int maxUserCount, | ||
List<RoutineResponse> routine | ||
) { | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/moabam/api/dto/room/SearchAllRoomsResponse.java
This file contains 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,13 @@ | ||
package com.moabam.api.dto.room; | ||
|
||
import java.util.List; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record SearchAllRoomsResponse( | ||
boolean hasNext, | ||
List<SearchAllRoomResponse> rooms | ||
) { | ||
|
||
} |
This file contains 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 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
Oops, something went wrong.
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.
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.
C: StreamUtils 적용할 수 있을듯!