diff --git a/src/main/java/ewha/lux/once/domain/home/controller/HomeController.java b/src/main/java/ewha/lux/once/domain/home/controller/HomeController.java index 83e0538..0546510 100644 --- a/src/main/java/ewha/lux/once/domain/home/controller/HomeController.java +++ b/src/main/java/ewha/lux/once/domain/home/controller/HomeController.java @@ -72,8 +72,8 @@ public CommonResponse announcedetail(@PathVariable Long announceId) { } } - // [Get] 사용자 근처 단골가게 조회 - @GetMapping("/gps") + // [Post] 사용자 근처 단골가게 조회 + @PostMapping("/gps") @ResponseBody public CommonResponse nearFavorite(@AuthenticationPrincipal UserAccount user, @RequestBody SearchStoresRequestDto nearFavoriteRequestDto){ try { diff --git a/src/main/java/ewha/lux/once/domain/home/service/HomeService.java b/src/main/java/ewha/lux/once/domain/home/service/HomeService.java index 0d0cfa1..4a3ca65 100644 --- a/src/main/java/ewha/lux/once/domain/home/service/HomeService.java +++ b/src/main/java/ewha/lux/once/domain/home/service/HomeService.java @@ -253,7 +253,7 @@ public AnnounceDetailDto getAnnounceDetail(Long announceId) throws CustomExcepti public List searchStores(SearchStoresRequestDto dto, Users nowuser) throws CustomException { // 단골가게 가져오기 List favorites = favoriteRepository.findAllByUsers(nowuser).get(); - System.out.println(favorites); + if(favorites.isEmpty()){ throw new CustomException(ResponseCode.NO_FAVORITE_STORE); } @@ -296,7 +296,7 @@ public List searchStores(SearchStoresRequestDto dto, Us } catch (Exception e){ throw new CustomException(ResponseCode.GOOGLE_MAP_SEARCH_PLACE_FAIL); } - + System.out.println(responsebody); if (responsebody.getPlaces() == null){ throw new CustomException(ResponseCode.NO_SEARCHED_FAVORITE_STORE); }