diff --git a/src/main/java/com/_8attery/seesaw/domain/battery/BatteryRepository.java b/src/main/java/com/_8attery/seesaw/domain/battery/BatteryRepository.java index 78f6b1e..c8d066d 100644 --- a/src/main/java/com/_8attery/seesaw/domain/battery/BatteryRepository.java +++ b/src/main/java/com/_8attery/seesaw/domain/battery/BatteryRepository.java @@ -69,7 +69,7 @@ public interface BatteryRepository extends JpaRepository { "where b2.user.id=:userId " + "and b1.createdAt between :startDate and :endDate " + "order by b1.createdAt desc") - List findUserBatteryHistory(@Param("userId") Long userId, @Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate); + List findUserBatteryHistory(@Param("userId") Long userId, @Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate); // 배터리 증감 조회 (30일 증감 내역) diff --git a/src/main/java/com/_8attery/seesaw/service/battery/BatteryService.java b/src/main/java/com/_8attery/seesaw/service/battery/BatteryService.java index d6885d0..d4adc70 100644 --- a/src/main/java/com/_8attery/seesaw/service/battery/BatteryService.java +++ b/src/main/java/com/_8attery/seesaw/service/battery/BatteryService.java @@ -109,8 +109,8 @@ public List getUserBatteryHistory(Long userId) throws // LocalDateTime endDate = LocalDateTime.now(); // Current date and time // LocalDateTime startDate = endDate.minusDays(7); // 7 days ago - LocalDate endDate = LocalDate.now(); // Current date and time - LocalDate startDate = endDate.minusDays(7); // 7 days ago + LocalDateTime endDate = LocalDate.now().atStartOfDay(); // Current date and time + LocalDateTime startDate = endDate.minusDays(7); // 7 days ago return batteryRepository.findUserBatteryHistory(userId, startDate, endDate);