Skip to content

[FEAT] 홈 화면 게스트하우스 목록 조회 #19

Merged
99hyuk merged 8 commits intodevelopfrom
feat/#17/guesthouse-home-room-list
Aug 6, 2025
Merged

[FEAT] 홈 화면 게스트하우스 목록 조회 #19
99hyuk merged 8 commits intodevelopfrom
feat/#17/guesthouse-home-room-list

Conversation

@junekyu02
Copy link
Contributor

@junekyu02 junekyu02 commented Jul 7, 2025

  • 광고 우선, 이름순 정렬
  • 페이징

📌 관련 이슈

  • closed: #issueNum

✨ PR 세부 내용

💬 리뷰 요청 사항

✅ 체크리스트

  • 빌드 및 테스트 통과
  • 주요 기능 정상 동작

@junekyu02 junekyu02 self-assigned this Jul 7, 2025
@junekyu02 junekyu02 added the ✨ feature 새로운 기능을 추가합니다 label Jul 7, 2025
@junekyu02 junekyu02 changed the base branch from main to develop July 7, 2025 08:36
@Transactional
public void activateAdvertisement(Long guesthouseId) {
Guesthouse guesthouse = guesthouseRepository.findById(guesthouseId)
.orElseThrow(() -> new SumteException(CommonErrorCode.NOT_EXIST));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

게스트하우스 전용 예외처리를 사용하면 더 좋을 것 같습니다!

Optional.ofNullable(roomRepository.findEarliestCheckinByGuesthouseId(gh.getId())).orElse("00:00"),
Optional.ofNullable(roomRepository.findMinPriceByGuesthouseId(gh.getId())).orElse(0L)
));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

체크인 시간과, 가격 같은 경우 0으로 제공되는 것보단 null이나 -1같은 특별한 값으로 프론트에서 처리할 수 있도록 하는 것이 좋아 보입니다. (관련 설명을 스웨거에도 기입해주면 좋겠죠?)

Double findAverageScoreByGuesthouseId(@Param("guesthouseId") Long guesthouseId);

@Query("SELECT COUNT(r) FROM Review r WHERE r.room.guesthouse.id = :guesthouseId")
int countByGuesthouseId(@Param("guesthouseId") Long guesthouseId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int countByRoomGuesthouseId(Long guesthouseId); 처럼 @Query 없이 메서드 쿼리로 구현 가능해 보입니다!

@99hyuk 99hyuk merged commit ca08e9e into develop Aug 6, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feature 새로운 기능을 추가합니다

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants