From b4a4b1bf50c4316b3c8b8207d2906beec3abc61c Mon Sep 17 00:00:00 2001 From: 5win <94297900+5win@users.noreply.github.com> Date: Wed, 13 Nov 2024 18:38:13 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=EC=A2=8C=ED=91=9C=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=EB=A5=BC=20=EC=BF=BC=EB=A6=AC=EC=8A=A4=ED=8A=B8=EB=A7=81?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B0=9B=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity/controller/ActivityController.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gamsa/activity/controller/ActivityController.java b/src/main/java/com/gamsa/activity/controller/ActivityController.java index 2a80f63..0841b5c 100644 --- a/src/main/java/com/gamsa/activity/controller/ActivityController.java +++ b/src/main/java/com/gamsa/activity/controller/ActivityController.java @@ -6,12 +6,12 @@ import com.gamsa.activity.dto.ActivityFindDistanceOrderRequest; import com.gamsa.activity.dto.ActivityFindSliceResponse; import com.gamsa.activity.service.ActivityService; +import java.math.BigDecimal; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -31,9 +31,12 @@ public Slice findSlice( @RequestParam(defaultValue = "false") boolean teenPossibleOnly, @RequestParam(defaultValue = "false") boolean beforeDeadlineOnly, @RequestParam(required = false) String keyword, - @RequestBody(required = false) ActivityFindDistanceOrderRequest distanceOrderRequest, + @RequestParam(required = false) BigDecimal latitude, + @RequestParam(required = false) BigDecimal longitude, + @RequestParam(required = false, defaultValue = "10") Integer distanceKm, Pageable pageable) { + // 필터링, 검색 관련 정보 ActivityFilterRequest filterRequest = ActivityFilterRequest.builder() .category(Category.fromValuesForSlice(category)) .sidoGunguCode(sidoGunguCode) @@ -43,6 +46,13 @@ public Slice findSlice( .keyword(keyword) .build(); + // 가까운 거리순 정렬 관련 정보 + ActivityFindDistanceOrderRequest distanceOrderRequest = ActivityFindDistanceOrderRequest.builder() + .latitude(latitude) + .longitude(longitude) + .distanceKm(distanceKm) + .build(); + return activityService.findSlice(filterRequest, distanceOrderRequest, pageable); } From e9c55f4141f7e4b2e5b4e17e574ade860974a58b Mon Sep 17 00:00:00 2001 From: 5win <94297900+5win@users.noreply.github.com> Date: Wed, 13 Nov 2024 18:53:02 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20TimeZone=20Asia/Seoul=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/gamsa/Application.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/gamsa/Application.java b/src/main/java/com/gamsa/Application.java index a5a8742..d4e3f5c 100644 --- a/src/main/java/com/gamsa/Application.java +++ b/src/main/java/com/gamsa/Application.java @@ -1,5 +1,6 @@ package com.gamsa; +import java.util.TimeZone; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.ConfigurationPropertiesScan; @@ -12,6 +13,7 @@ @SpringBootApplication public class Application { public static void main(String[] args) { + TimeZone.setDefault(TimeZone.getTimeZone("Asia/Seoul")); SpringApplication.run(Application.class, args); } }