From d8e01ad93dcd6e7c5b70d294d61a6a47f266a1db Mon Sep 17 00:00:00 2001 From: seohyun-lee Date: Wed, 17 Jul 2024 15:15:16 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20HomeController,=20HomeService=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/member/controller/HomeController.java | 12 ++++++++++++ .../songpin/domain/member/service/HomeService.java | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/main/java/sws/songpin/domain/member/controller/HomeController.java create mode 100644 src/main/java/sws/songpin/domain/member/service/HomeService.java diff --git a/src/main/java/sws/songpin/domain/member/controller/HomeController.java b/src/main/java/sws/songpin/domain/member/controller/HomeController.java new file mode 100644 index 00000000..f62f2a4e --- /dev/null +++ b/src/main/java/sws/songpin/domain/member/controller/HomeController.java @@ -0,0 +1,12 @@ +package sws.songpin.domain.member.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "Home", description = "Home 기능 관련 API입니다.") +@RestController +@RequiredArgsConstructor +public class HomeController { + +} diff --git a/src/main/java/sws/songpin/domain/member/service/HomeService.java b/src/main/java/sws/songpin/domain/member/service/HomeService.java new file mode 100644 index 00000000..e7543098 --- /dev/null +++ b/src/main/java/sws/songpin/domain/member/service/HomeService.java @@ -0,0 +1,11 @@ +package sws.songpin.domain.member.service; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@Transactional +@RequiredArgsConstructor +public class HomeService { +} From c39fd706bc05a684387aafbd7ab164497460e983 Mon Sep 17 00:00:00 2001 From: seohyun-lee Date: Thu, 18 Jul 2024 03:46:58 +0900 Subject: [PATCH 2/2] =?UTF-8?q?hoxfix:=20nativeQuery=20=EB=82=B4=20table?= =?UTF-8?q?=EB=AA=85=20=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../songpin/domain/place/repository/PlaceRepository.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/sws/songpin/domain/place/repository/PlaceRepository.java b/src/main/java/sws/songpin/domain/place/repository/PlaceRepository.java index 27ed1bcd..3b530fef 100644 --- a/src/main/java/sws/songpin/domain/place/repository/PlaceRepository.java +++ b/src/main/java/sws/songpin/domain/place/repository/PlaceRepository.java @@ -8,21 +8,20 @@ import sws.songpin.domain.place.entity.Place; import java.time.LocalDate; -import java.util.List; import java.util.Optional; public interface PlaceRepository extends JpaRepository { Optional findByProviderAddressId(Long providerAddressId); // 좌표 범위에 포함되는 장소들 불러오기 - @Query(value = "SELECT p.* FROM Place p " + + @Query(value = "SELECT p.* FROM place p " + "JOIN pin ON p.place_id = pin.place_id " + "WHERE p.latitude BETWEEN :swLat AND :neLat " + "AND p.longitude BETWEEN :swLng AND :neLng " + "GROUP BY p.place_id " + "HAVING COUNT(pin.pin_id) > 0 " + "ORDER BY MAX(pin.listened_date) DESC, p.place_id DESC", - countQuery = "SELECT COUNT(DISTINCT p.place_id) FROM Place p " + + countQuery = "SELECT COUNT(DISTINCT p.place_id) FROM place p " + "JOIN pin ON p.place_id = pin.place_id " + "WHERE p.latitude BETWEEN :swLat AND :neLat " + "AND p.longitude BETWEEN :swLng AND :neLng " + @@ -38,7 +37,7 @@ Page findAllByLatitudeBetweenAndLongitudeBetween( ); // 좌표 범위 & 기간 범위에 모두 포함되는 장소들 불러오기 - @Query(value = "SELECT p.* FROM Place p " + + @Query(value = "SELECT p.* FROM place p " + "JOIN pin ON p.place_id = pin.place_id " + "WHERE p.latitude BETWEEN :swLat AND :neLat " + "AND p.longitude BETWEEN :swLng AND :neLng " + @@ -46,7 +45,7 @@ Page findAllByLatitudeBetweenAndLongitudeBetween( "GROUP BY p.place_id " + "HAVING COUNT(pin.pin_id) > 0 " + "ORDER BY MAX(pin.listened_date) DESC, p.place_id DESC", - countQuery = "SELECT COUNT(DISTINCT p.place_id) FROM Place p " + + countQuery = "SELECT COUNT(DISTINCT p.place_id) FROM place p " + "JOIN pin ON p.place_id = pin.place_id " + "WHERE p.latitude BETWEEN :swLat AND :neLat " + "AND p.longitude BETWEEN :swLng AND :neLng " +