From 84971d432a9e3afa5dbcd49d9caacec4b18e41eb Mon Sep 17 00:00:00 2001 From: bbbang105 <2018111366@dgu.ac.kr> Date: Mon, 10 Jun 2024 00:54:20 +0900 Subject: [PATCH] =?UTF-8?q?#53=20[style]=20:=20=EB=B3=80=EC=88=98=EB=AA=85?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/dgu/backend/controller/CandleInfoController.java | 2 +- .../org/dgu/backend/repository/CandleInfoRepository.java | 6 ++++-- .../java/org/dgu/backend/service/CandleInfoService.java | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/org/dgu/backend/controller/CandleInfoController.java b/backend/src/main/java/org/dgu/backend/controller/CandleInfoController.java index 8deb250..1091fd0 100644 --- a/backend/src/main/java/org/dgu/backend/controller/CandleInfoController.java +++ b/backend/src/main/java/org/dgu/backend/controller/CandleInfoController.java @@ -35,7 +35,7 @@ public ResponseEntity> collectCandleData( @RequestParam("end_date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endDate, @RequestParam("candle_name") String candleName) { - candleDataCollector.collectCandleData(koreanName, startDate, endDate, candleName); + candleDataCollector.collectCandleData(koreanName, candleName, startDate, endDate); return ApiResponse.onSuccess(SuccessStatus.SUCCESS_CANDLE_INFOS); } diff --git a/backend/src/main/java/org/dgu/backend/repository/CandleInfoRepository.java b/backend/src/main/java/org/dgu/backend/repository/CandleInfoRepository.java index bf4c496..b246990 100644 --- a/backend/src/main/java/org/dgu/backend/repository/CandleInfoRepository.java +++ b/backend/src/main/java/org/dgu/backend/repository/CandleInfoRepository.java @@ -10,9 +10,11 @@ import java.util.List; public interface CandleInfoRepository extends JpaRepository { - @Query("SELECT c FROM CandleInfo c WHERE c.candle = :candle AND c.dateTime BETWEEN :startDate AND :endDate ORDER BY c.dateTime") - List findFilteredCandleInfo(Candle candle, LocalDateTime startDate, LocalDateTime endDate); + @Query("SELECT c FROM CandleInfo c WHERE c.market = :market AND c.candle = :candle AND c.dateTime BETWEEN :startDate AND :endDate ORDER BY c.dateTime") + List findFilteredCandleInfo(Market market, Candle candle, LocalDateTime startDate, LocalDateTime endDate); @Query("SELECT c FROM CandleInfo c WHERE c.market = :market AND c.candle = :candle AND c.dateTime > :startDate ORDER BY c.dateTime") List findByMarketAndCandleAndDateTimeAfter(Market market, Candle candle, LocalDateTime startDate); + + CandleInfo findTopByMarketAndCandleOrderByTimestampDesc(Market market, Candle candle); } \ No newline at end of file diff --git a/backend/src/main/java/org/dgu/backend/service/CandleInfoService.java b/backend/src/main/java/org/dgu/backend/service/CandleInfoService.java index 5ee4f02..bbddfc0 100644 --- a/backend/src/main/java/org/dgu/backend/service/CandleInfoService.java +++ b/backend/src/main/java/org/dgu/backend/service/CandleInfoService.java @@ -3,5 +3,5 @@ import java.time.LocalDateTime; public interface CandleInfoService { - void getCandleInfo(String marketKoreanName, LocalDateTime to, int count, String candleType); + void getCandleInfo(String koreanName, LocalDateTime to, int count, String candleName); } \ No newline at end of file