diff --git a/src/main/java/sevenstar/marineleisure/activity/controller/ActivityController.java b/src/main/java/sevenstar/marineleisure/activity/controller/ActivityController.java index fd99ff80..e3d931dd 100644 --- a/src/main/java/sevenstar/marineleisure/activity/controller/ActivityController.java +++ b/src/main/java/sevenstar/marineleisure/activity/controller/ActivityController.java @@ -5,9 +5,9 @@ import java.util.Map; import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -30,7 +30,7 @@ public class ActivityController { private final ActivityService activityService; @GetMapping("/index") - public ResponseEntity>> getActivityIndex(@RequestBody ActivityIndexRequest activityIndexRequest) { + public ResponseEntity>> getActivityIndex(@ModelAttribute ActivityIndexRequest activityIndexRequest) { return BaseResponse.success(activityService.getActivitySummary( activityIndexRequest.latitude(), activityIndexRequest.longitude(), @@ -39,21 +39,21 @@ public ResponseEntity>> getAct } @GetMapping("/{activity}/detail") - public ResponseEntity> getActivityDetail(@PathVariable ActivityCategory activity, @RequestBody ActivityDetailRequest activityDetailRequest) { + public ResponseEntity> getActivityDetail(@PathVariable ActivityCategory activity, @ModelAttribute ActivityDetailRequest activityDetailRequest) { try { return BaseResponse.success(activityService.getActivityDetail(activity, activityDetailRequest.latitude(), activityDetailRequest.longitude())); } catch (RuntimeException e) { - return BaseResponse.error(WEATHER_NOT_FOUND); + return BaseResponse.error(INVALID_ACTIVITY); } } @GetMapping("/weather") - public ResponseEntity> getActivityWeather(@RequestBody ActivityWeatherRequest activityWeatherRequest) { + public ResponseEntity> getActivityWeather(@ModelAttribute ActivityWeatherRequest activityWeatherRequest) { try { return BaseResponse.success(activityService.getWeatherBySpot(activityWeatherRequest.latitude(), activityWeatherRequest.longitude())); } catch (Exception e) { - return BaseResponse.error(INVALID_ACTIVITY); + return BaseResponse.error(WEATHER_NOT_FOUND); } } diff --git a/src/main/java/sevenstar/marineleisure/favorite/controller/FavoriteController.java b/src/main/java/sevenstar/marineleisure/favorite/controller/FavoriteController.java index 58ffc236..1ec58d6a 100644 --- a/src/main/java/sevenstar/marineleisure/favorite/controller/FavoriteController.java +++ b/src/main/java/sevenstar/marineleisure/favorite/controller/FavoriteController.java @@ -27,7 +27,7 @@ @RestController @RequiredArgsConstructor -@RequestMapping("/favorite") +@RequestMapping("/favorites") public class FavoriteController { private final FavoriteServiceImpl service; @@ -51,7 +51,7 @@ public ResponseEntity> addFavorite(@PathVariable Long id) { @GetMapping public ResponseEntity> searchFavorites( @RequestParam(defaultValue = "0") Long cursorId, - @RequestParam(defaultValue = "20") @Min(1) @Max(10) int size) { + @RequestParam(defaultValue = "20") @Min(1) @Max(20) int size) { List result = service.searchFavorite(cursorId, size); boolean hasNext = result.size() > size; diff --git a/src/main/java/sevenstar/marineleisure/global/api/kakao/service/PresetSchedulerService.java b/src/main/java/sevenstar/marineleisure/global/api/kakao/service/PresetSchedulerService.java index 63daf4a8..519e037b 100644 --- a/src/main/java/sevenstar/marineleisure/global/api/kakao/service/PresetSchedulerService.java +++ b/src/main/java/sevenstar/marineleisure/global/api/kakao/service/PresetSchedulerService.java @@ -23,7 +23,7 @@ public class PresetSchedulerService { @Transactional public void updateRegionApi() { LocalDate now = LocalDate.now(); - BestSpot emptySpot = new BestSpot(-1L, "없는 지역입니다", TotalIndex.NONE); + BestSpot emptySpot = new BestSpot(-1L, "없는 지역입니다", TotalIndex.NONE, 0, 0); for (Region region : Region.getAllKoreaRegion()) { evictRegionCache(region); BestSpot bestSpotInFishing = outdoorSpotRepository.findBestSpotInFishing(region.getLatitude(), @@ -36,10 +36,14 @@ public void updateRegionApi() { region.getLongitude(), now, PRESET_RADIUS).map(BestSpot::new).orElse(emptySpot); spotPresetRepository.upsert(region.name(), bestSpotInFishing.getSpotId(), bestSpotInFishing.getName(), - bestSpotInFishing.getTotalIndex().name(), bestSpotInMudflat.getSpotId(), bestSpotInMudflat.getName(), - bestSpotInMudflat.getTotalIndex().name(), bestSpotInScuba.getSpotId(), bestSpotInScuba.getName(), - bestSpotInScuba.getTotalIndex().name(), bestSpotInSurfing.getSpotId(), bestSpotInSurfing.getName(), - bestSpotInSurfing.getTotalIndex().name()); + bestSpotInFishing.getTotalIndex().name(), bestSpotInFishing.getMonthView(), + bestSpotInFishing.getWeekView(), bestSpotInMudflat.getSpotId(), bestSpotInMudflat.getName(), + bestSpotInMudflat.getTotalIndex().name(), bestSpotInMudflat.getMonthView(), + bestSpotInMudflat.getWeekView(), bestSpotInScuba.getSpotId(), bestSpotInScuba.getName(), + bestSpotInScuba.getTotalIndex().name(), bestSpotInScuba.getMonthView(), bestSpotInScuba.getWeekView(), + bestSpotInSurfing.getSpotId(), bestSpotInSurfing.getName(), + bestSpotInSurfing.getTotalIndex().name(), bestSpotInSurfing.getMonthView(), + bestSpotInSurfing.getWeekView()); } } diff --git a/src/main/java/sevenstar/marineleisure/global/exception/enums/ActivityErrorCode.java b/src/main/java/sevenstar/marineleisure/global/exception/enums/ActivityErrorCode.java index d09810f8..9389cde1 100644 --- a/src/main/java/sevenstar/marineleisure/global/exception/enums/ActivityErrorCode.java +++ b/src/main/java/sevenstar/marineleisure/global/exception/enums/ActivityErrorCode.java @@ -22,16 +22,16 @@ public enum ActivityErrorCode implements ErrorCode { @Override public int getCode() { - return 0; + return this.code; } @Override public HttpStatus getHttpStatus() { - return null; + return this.httpStatus; } @Override public String getMessage() { - return ""; + return this.message; } } diff --git a/src/main/java/sevenstar/marineleisure/member/service/OauthService.java b/src/main/java/sevenstar/marineleisure/member/service/OauthService.java index 82dfe80c..031d8104 100644 --- a/src/main/java/sevenstar/marineleisure/member/service/OauthService.java +++ b/src/main/java/sevenstar/marineleisure/member/service/OauthService.java @@ -18,12 +18,11 @@ import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; -import ch.qos.logback.core.joran.action.ParamAction; import jakarta.servlet.http.HttpServletRequest; import jakarta.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import sevenstar.marineleisure.global.util.PkceUtil; +import sevenstar.marineleisure.global.enums.MemberStatus; import sevenstar.marineleisure.global.util.StateEncryptionUtil; import sevenstar.marineleisure.member.domain.Member; import sevenstar.marineleisure.member.dto.KakaoTokenResponse; @@ -37,7 +36,6 @@ public class OauthService { private final MemberRepository memberRepository; private final WebClient webClient; private final StateEncryptionUtil stateEncryptionUtil; - private final PkceUtil pkceUtil; @Value("${kakao.login.api_key}") private String apiKey; @@ -45,6 +43,9 @@ public class OauthService { @Value("${kakao.login.client_secret}") private String clientSecret; + @Value("${kakao.login.admin_key}") + private String adminKey; + @Value("${kakao.login.uri.base}") private String kakaoBaseUri; @@ -206,6 +207,7 @@ private Member saveOrUpdateKakaoUser(Map memberAttributes) { .longitude(BigDecimal.ZERO) .build()); member.updateNickname(nickname); + member.updateStatus(MemberStatus.ACTIVE); // 재가입 시 상태를 ACTIVE로 변경 return memberRepository.save(member); } @@ -234,7 +236,7 @@ public Long unlinkKakaoAccount(String providerId) { Map response = webClient.post() .uri(unlinkUrl) - .header("Authorization", "KakaoAK " + clientSecret) + .header("Authorization", "KakaoAK " + adminKey) .header("Content-Type", "application/x-www-form-urlencoded;charset=utf-8") .body(BodyInserters.fromFormData(params)) .retrieve() diff --git a/src/main/java/sevenstar/marineleisure/spot/domain/BestSpot.java b/src/main/java/sevenstar/marineleisure/spot/domain/BestSpot.java index 082700cd..40a17fcd 100644 --- a/src/main/java/sevenstar/marineleisure/spot/domain/BestSpot.java +++ b/src/main/java/sevenstar/marineleisure/spot/domain/BestSpot.java @@ -17,16 +17,22 @@ public class BestSpot { private String name; @Enumerated(EnumType.STRING) private TotalIndex totalIndex; + private Integer monthView; + private Integer weekView; - public BestSpot(Long spotId, String name, TotalIndex totalIndex) { + public BestSpot(Long spotId, String name, TotalIndex totalIndex, Integer monthView, Integer weekView) { this.spotId = spotId; this.name = name; this.totalIndex = totalIndex; + this.monthView = monthView; + this.weekView = weekView; } public BestSpot(BestSpotProjection bestSpotProjection) { this.spotId = bestSpotProjection.getId(); this.name = bestSpotProjection.getName(); this.totalIndex = bestSpotProjection.getTotalIndex(); + this.monthView = bestSpotProjection.getMonthView(); + this.weekView = bestSpotProjection.getWeekView(); } } diff --git a/src/main/java/sevenstar/marineleisure/spot/domain/SpotPreset.java b/src/main/java/sevenstar/marineleisure/spot/domain/SpotPreset.java index 5d4e7ded..1efb5984 100644 --- a/src/main/java/sevenstar/marineleisure/spot/domain/SpotPreset.java +++ b/src/main/java/sevenstar/marineleisure/spot/domain/SpotPreset.java @@ -27,7 +27,9 @@ public class SpotPreset { @AttributeOverrides({ @AttributeOverride(name = "spotId",column = @Column(name = "fishing_spot_id")), @AttributeOverride(name = "name",column = @Column(name = "fishing_name")), - @AttributeOverride(name = "totalIndex",column = @Column(name = "fishing_total_index")) + @AttributeOverride(name = "totalIndex",column = @Column(name = "fishing_total_index")), + @AttributeOverride(name = "monthView",column = @Column(name = "fishing_monthView")), + @AttributeOverride(name = "weekView",column = @Column(name = "fishing_weekView")) }) private BestSpot fishing; @@ -35,7 +37,9 @@ public class SpotPreset { @AttributeOverrides({ @AttributeOverride(name = "spotId",column = @Column(name = "mudflat_spot_id")), @AttributeOverride(name = "name",column = @Column(name = "mudflat_name")), - @AttributeOverride(name = "totalIndex",column = @Column(name = "mudflat_total_index")) + @AttributeOverride(name = "totalIndex",column = @Column(name = "mudflat_total_index")), + @AttributeOverride(name = "monthView",column = @Column(name = "mudflat_monthView")), + @AttributeOverride(name = "weekView",column = @Column(name = "mudflat_weekView")) }) private BestSpot mudflat; @@ -43,7 +47,9 @@ public class SpotPreset { @AttributeOverrides({ @AttributeOverride(name = "spotId",column = @Column(name = "scuba_spot_id")), @AttributeOverride(name = "name",column = @Column(name = "scuba_name")), - @AttributeOverride(name = "totalIndex",column = @Column(name = "scuba_total_index")) + @AttributeOverride(name = "totalIndex",column = @Column(name = "scuba_total_index")), + @AttributeOverride(name = "monthView",column = @Column(name = "scuba_monthView")), + @AttributeOverride(name = "weekView",column = @Column(name = "scuba_weekView")) }) private BestSpot scuba; @@ -51,7 +57,9 @@ public class SpotPreset { @AttributeOverrides({ @AttributeOverride(name = "spotId",column = @Column(name = "surfing_spot_id")), @AttributeOverride(name = "name",column = @Column(name = "surfing_name")), - @AttributeOverride(name = "totalIndex",column = @Column(name = "surfing_total_index")) + @AttributeOverride(name = "totalIndex",column = @Column(name = "surfing_total_index")), + @AttributeOverride(name = "monthView",column = @Column(name = "surfing_monthView")), + @AttributeOverride(name = "weekView",column = @Column(name = "surfing_weekView")) }) private BestSpot surfing; diff --git a/src/main/java/sevenstar/marineleisure/spot/dto/projection/BestSpotProjection.java b/src/main/java/sevenstar/marineleisure/spot/dto/projection/BestSpotProjection.java index 74181bd2..a3d9cf6d 100644 --- a/src/main/java/sevenstar/marineleisure/spot/dto/projection/BestSpotProjection.java +++ b/src/main/java/sevenstar/marineleisure/spot/dto/projection/BestSpotProjection.java @@ -6,4 +6,6 @@ public interface BestSpotProjection { Long getId(); String getName(); TotalIndex getTotalIndex(); + Integer getMonthView(); + Integer getWeekView(); } diff --git a/src/main/java/sevenstar/marineleisure/spot/mapper/SpotMapper.java b/src/main/java/sevenstar/marineleisure/spot/mapper/SpotMapper.java index 96b835c0..2b6210b7 100644 --- a/src/main/java/sevenstar/marineleisure/spot/mapper/SpotMapper.java +++ b/src/main/java/sevenstar/marineleisure/spot/mapper/SpotMapper.java @@ -20,7 +20,7 @@ public static SpotReadResponse.SpotInfo toDto(SpotDistanceProjection spotDistanc return new SpotReadResponse.SpotInfo(spotDistanceProjection.getId(), spotDistanceProjection.getName(), ActivityCategory.parse(spotDistanceProjection.getCategory()), spotDistanceProjection.getLatitude().floatValue(), spotDistanceProjection.getLongitude().floatValue(), - spotDistanceProjection.getDistance().floatValue(), totalIndex, spotViewQuartile.getMonthQuartile(), + spotDistanceProjection.getDistance().floatValue() / 1000f, totalIndex, spotViewQuartile.getMonthQuartile(), spotViewQuartile.getWeekQuartile(), isFavorite); } diff --git a/src/main/java/sevenstar/marineleisure/spot/repository/OutdoorSpotRepository.java b/src/main/java/sevenstar/marineleisure/spot/repository/OutdoorSpotRepository.java index 8d151312..a50e3398 100644 --- a/src/main/java/sevenstar/marineleisure/spot/repository/OutdoorSpotRepository.java +++ b/src/main/java/sevenstar/marineleisure/spot/repository/OutdoorSpotRepository.java @@ -31,7 +31,20 @@ List findSpots(@Param("latitude") Float latitude, @Param // Fishing Forecast @Query(value = """ - SELECT os.id AS id, os.name AS name, f.total_index AS totalIndex + SELECT os.id AS id, os.name AS name, f.total_index AS totalIndex, + COALESCE(( + SELECT SUM(svs.view_count) + FROM spot_view_stats svs + WHERE svs.spot_id = os.id + AND svs.view_date BETWEEN :forecastDate - INTERVAL 6 DAY AND :forecastDate + ), 0) AS weekView, + + COALESCE(( + SELECT SUM(svs.view_count) + FROM spot_view_stats svs + WHERE svs.spot_id = os.id + AND svs.view_date BETWEEN :forecastDate - INTERVAL 29 DAY AND :forecastDate + ), 0) AS monthView FROM outdoor_spots os JOIN fishing_forecast f ON os.id = f.spot_id WHERE f.forecast_date = :forecastDate @@ -53,7 +66,20 @@ Optional findBestSpotInFishing(@Param("latitude") double lat // Mudflat Forecast @Query(value = """ - SELECT os.id AS id, os.name AS name, m.total_index AS totalIndex + SELECT os.id AS id, os.name AS name, m.total_index AS totalIndex, + COALESCE(( + SELECT SUM(svs.view_count) + FROM spot_view_stats svs + WHERE svs.spot_id = os.id + AND svs.view_date BETWEEN :forecastDate - INTERVAL 6 DAY AND :forecastDate + ), 0) AS weekView, + + COALESCE(( + SELECT SUM(svs.view_count) + FROM spot_view_stats svs + WHERE svs.spot_id = os.id + AND svs.view_date BETWEEN :forecastDate - INTERVAL 29 DAY AND :forecastDate + ), 0) AS monthView FROM outdoor_spots os JOIN mudflat_forecast m ON os.id = m.spot_id WHERE m.forecast_date = :forecastDate @@ -75,7 +101,20 @@ Optional findBestSpotInMudflat(@Param("latitude") double lat // Surfing Forecast @Query(value = """ - SELECT os.id AS id, os.name AS name, s.total_index AS totalIndex + SELECT os.id AS id, os.name AS name, s.total_index AS totalIndex, + COALESCE(( + SELECT SUM(svs.view_count) + FROM spot_view_stats svs + WHERE svs.spot_id = os.id + AND svs.view_date BETWEEN :forecastDate - INTERVAL 6 DAY AND :forecastDate + ), 0) AS weekView, + + COALESCE(( + SELECT SUM(svs.view_count) + FROM spot_view_stats svs + WHERE svs.spot_id = os.id + AND svs.view_date BETWEEN :forecastDate - INTERVAL 29 DAY AND :forecastDate + ), 0) AS monthView FROM outdoor_spots os JOIN surfing_forecast s ON os.id = s.spot_id WHERE s.forecast_date = :forecastDate @@ -97,7 +136,20 @@ Optional findBestSpotInSurfing(@Param("latitude") double lat // Scuba Forecast @Query(value = """ - SELECT os.id AS id, os.name AS name, s.total_index AS totalIndex + SELECT os.id AS id, os.name AS name, s.total_index AS totalIndex, + COALESCE(( + SELECT SUM(svs.view_count) + FROM spot_view_stats svs + WHERE svs.spot_id = os.id + AND svs.view_date BETWEEN :forecastDate - INTERVAL 6 DAY AND :forecastDate + ), 0) AS weekView, + + COALESCE(( + SELECT SUM(svs.view_count) + FROM spot_view_stats svs + WHERE svs.spot_id = os.id + AND svs.view_date BETWEEN :forecastDate - INTERVAL 29 DAY AND :forecastDate + ), 0) AS monthView FROM outdoor_spots os JOIN scuba_forecast s ON os.id = s.spot_id WHERE s.forecast_date = :forecastDate diff --git a/src/main/java/sevenstar/marineleisure/spot/repository/SpotPresetRepository.java b/src/main/java/sevenstar/marineleisure/spot/repository/SpotPresetRepository.java index 142577ff..b7263456 100644 --- a/src/main/java/sevenstar/marineleisure/spot/repository/SpotPresetRepository.java +++ b/src/main/java/sevenstar/marineleisure/spot/repository/SpotPresetRepository.java @@ -12,52 +12,68 @@ public interface SpotPresetRepository extends JpaRepository { @Modifying @Query(value = """ - INSERT INTO spot_preset ( - region, - fishing_spot_id, fishing_name, fishing_total_index, - mudflat_spot_id, mudflat_name, mudflat_total_index, - scuba_spot_id, scuba_name, scuba_total_index, - surfing_spot_id, surfing_name, surfing_total_index - ) - VALUES ( - :region, - :fishingId, :fishingName, :fishingTotalIndex, - :mudflatId, :mudflatName, :mudflatTotalIndex, - :scubaId, :scubaName, :scubaTotalIndex, - :surfingId, :surfingName, :surfingTotalIndex - ) - ON DUPLICATE KEY UPDATE - fishing_spot_id = VALUES(fishing_spot_id), - fishing_name = VALUES(fishing_name), - fishing_total_index = VALUES(fishing_total_index), - mudflat_spot_id = VALUES(mudflat_spot_id), - mudflat_name = VALUES(mudflat_name), - mudflat_total_index = VALUES(mudflat_total_index), - scuba_spot_id = VALUES(scuba_spot_id), - scuba_name = VALUES(scuba_name), - scuba_total_index = VALUES(scuba_total_index), - surfing_spot_id = VALUES(surfing_spot_id), - surfing_name = VALUES(surfing_name), - surfing_total_index = VALUES(surfing_total_index) -""", nativeQuery = true) + INSERT INTO spot_preset ( + region, + fishing_spot_id, fishing_name, fishing_total_index, fishing_month_view, fishing_week_view, + mudflat_spot_id, mudflat_name, mudflat_total_index, mudflat_month_view, mudflat_week_view, + scuba_spot_id, scuba_name, scuba_total_index, scuba_month_view, scuba_week_view, + surfing_spot_id, surfing_name, surfing_total_index, surfing_month_view, surfing_week_view + ) + VALUES ( + :region, + :fishingId, :fishingName, :fishingTotalIndex,:fishingMonthView, :fishingWeekView, + :mudflatId, :mudflatName, :mudflatTotalIndex,:mudflatMonthView, :mudflatWeekView, + :scubaId, :scubaName, :scubaTotalIndex,:scubaMonthView, :scubaWeekView, + :surfingId, :surfingName, :surfingTotalIndex,:surfingMonthView, :surfingWeekView + ) + ON DUPLICATE KEY UPDATE + fishing_spot_id = VALUES(fishing_spot_id), + fishing_name = VALUES(fishing_name), + fishing_total_index = VALUES(fishing_total_index), + fishing_month_view= VALUES(fishing_month_view), + fishing_week_view=VALUES(fishing_week_view), + mudflat_spot_id = VALUES(mudflat_spot_id), + mudflat_name = VALUES(mudflat_name), + mudflat_total_index = VALUES(mudflat_total_index), + mudflat_month_view = VALUES(mudflat_month_view), + mudflat_week_view = VALUES(mudflat_week_view), + scuba_spot_id = VALUES(scuba_spot_id), + scuba_name = VALUES(scuba_name), + scuba_total_index = VALUES(scuba_total_index), + scuba_month_view = VALUES(scuba_month_view), + scuba_week_view = VALUES(scuba_week_view), + surfing_spot_id = VALUES(surfing_spot_id), + surfing_name = VALUES(surfing_name), + surfing_total_index = VALUES(surfing_total_index), + surfing_month_view = VALUES(surfing_month_view), + surfing_week_view = VALUES(surfing_week_view) + """, nativeQuery = true) void upsert( @Param("region") String region, @Param("fishingId") Long fishingId, @Param("fishingName") String fishingName, @Param("fishingTotalIndex") String fishingTotalIndex, + @Param("fishingMonthView") Integer fishingMonthView, + @Param("fishingWeekView") Integer fishingWeekView, @Param("mudflatId") Long mudflatId, @Param("mudflatName") String mudflatName, @Param("mudflatTotalIndex") String mudflatTotalIndex, + @Param("mudflatMonthView") Integer mudflatMonthView, + @Param("mudflatWeekView") Integer mudflatWeekView, @Param("scubaId") Long scubaId, @Param("scubaName") String scubaName, @Param("scubaTotalIndex") String scubaTotalIndex, + @Param("scubaMonthView") Integer scubaMonthView, + @Param("scubaWeekView") Integer scubaWeekView, @Param("surfingId") Long surfingId, @Param("surfingName") String surfingName, - @Param("surfingTotalIndex") String surfingTotalIndex + @Param("surfingTotalIndex") String surfingTotalIndex, + @Param("surfingMonthView") Integer surfingMonthView, + @Param("surfingWeekView") Integer surfingWeekView ); } \ No newline at end of file diff --git a/src/main/java/sevenstar/marineleisure/spot/repository/SpotViewStatsRepository.java b/src/main/java/sevenstar/marineleisure/spot/repository/SpotViewStatsRepository.java index 3cfe3f8e..2d75512c 100644 --- a/src/main/java/sevenstar/marineleisure/spot/repository/SpotViewStatsRepository.java +++ b/src/main/java/sevenstar/marineleisure/spot/repository/SpotViewStatsRepository.java @@ -18,5 +18,4 @@ INSERT INTO spot_view_stats (spot_id, view_date, view_count) VALUES (:spotId,:viewDate,1) ON DUPLICATE KEY UPDATE view_count = view_count + 1 """, nativeQuery = true) void upsertViewStats(@Param("spotId") Long spotId, @Param("viewDate") LocalDate viewDate); - } \ No newline at end of file diff --git a/src/main/java/sevenstar/marineleisure/spot/service/SpotServiceImpl.java b/src/main/java/sevenstar/marineleisure/spot/service/SpotServiceImpl.java index 9d3af462..95376b0f 100644 --- a/src/main/java/sevenstar/marineleisure/spot/service/SpotServiceImpl.java +++ b/src/main/java/sevenstar/marineleisure/spot/service/SpotServiceImpl.java @@ -114,7 +114,7 @@ public SpotPreviewReadResponse preview(float latitude, float longitude) { Region region = geoUtils.searchRegion(latitude, longitude); if (region == Region.OCEAN) { LocalDate now = LocalDate.now(); - BestSpot emptySpot = new BestSpot(-1L, "없는 지역입니다", null); + BestSpot emptySpot = new BestSpot(-1L, "없는 지역입니다", null,0,0); double radius = 500_000; BestSpot bestSpotInFishing = outdoorSpotRepository.findBestSpotInFishing(region.getLatitude(), region.getLongitude(), now, radius).map(BestSpot::new).orElse(emptySpot); diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 128dc48d..bab7bc62 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -61,6 +61,7 @@ kakao: login: api_key: ${KAKAO_API_KEY} client_secret: ${KAKAO_CLIENT_SECRET} + admin_key: ${KAKAO_ADMIN_KEY} redirect_uri: ${KAKAO_REDIRECT_URI} uri: @@ -70,6 +71,6 @@ kakao: uri: https://dapi.kakao.com/v2/local/geo/coord2regioncode jwt: secret: ${JWT_SECRET} - access-token-validity-in-seconds: 300 + access-token-validity-in-seconds: 3600 refresh-token-validity-in-seconds: 86400 # 24시간 use-cookie: false # 개발 환경에서. 클라이언트 개발 완료 후 쿠키 사용 방식으로 변경. \ No newline at end of file