Open
Conversation
…rchController(+Test) 구현"
sunH0
approved these changes
Nov 3, 2021
| private String roughAddress; | ||
|
|
||
| @Builder | ||
| public SearchOneResponse(Room entity) { |
Collaborator
There was a problem hiding this comment.
Respose의 convert해주는 과정에서 생성자보다 static으로 선언한 of 메소드를 해주는 것이 좀 더 명확한 느낌아닌 느낌이 들어요 ㅎㅎ
어떻게 생각하시나요??
Comment on lines
+14
to
+18
| private String location; | ||
| private LocalDate startDate; | ||
| private LocalDate endDate; | ||
| private Guest guest; | ||
| private Option option; |
Comment on lines
+14
to
+18
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| //@RequestMapping("/v1/search") | ||
| @Slf4j |
| import org.springframework.data.domain.Pageable; | ||
|
|
||
| public interface CustomizedRoomRepository { | ||
| Page<Room> findByFiltersOrderByCreatedAt(final SearchRequest searchRequest, Pageable pageable); |
Collaborator
There was a problem hiding this comment.
final을 붙인다면 Pageable 도 해주면 좋을 것 같아요!!
|
|
||
| public interface RoomRepository extends JpaRepository<Room, Long> { | ||
|
|
||
| @Repository |
|
|
||
| //필터별조회 | ||
| @Transactional(readOnly = true) | ||
| public Page<SearchAllResponse> findByFilters(final SearchRequest searchRequest, Pageable pageable){ |
BeautterLife
approved these changes
Nov 3, 2021
Collaborator
BeautterLife
left a comment
There was a problem hiding this comment.
query dsl 굿입니다
수고하셨어요
| import org.programmers.staybb.domain.room.Room; | ||
|
|
||
| @Getter | ||
| @Setter |
|
|
||
| @Builder | ||
| public SearchOneResponse(Room entity) { | ||
| this.id = entity.getId(); |
Comment on lines
+24
to
+26
| this.guest = new Guest(searchRequestModel.getAdult(), | ||
| searchRequestModel.getKid(), | ||
| searchRequestModel.getTeen()); |
Collaborator
There was a problem hiding this comment.
Guest 같이 필드가 많이 않은 클래스는 생성자를 사용해도 괜찮지 않을까요??
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
SearchService::findByFilters(+Test) : querydsl 사용하여 구현
SearchController (+Test) 구현
1차적인 SearchService구현은 이것으로 마무리합니다.
생각해볼 것 ->
StartDate, EndDate 검색 방법(예약 달력 api 찾아보기, 뇌피셜 아이디어: mysql 달력)