-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 방 전체 목록 조회 컨트롤러 추가 * refactor: 방장 member 반환 기능 삭제 * feat: 방 검색 dto 추가 * feat: 방 전체 조회 기능 구현 * fix: 서비스, 컨트롤러 수정 * test: 서비스 단위 테스트 작성 * test: 통합 테스트 작성 * fix: 피연산자 Long으로 수정
- Loading branch information
Showing
16 changed files
with
686 additions
and
69 deletions.
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.