Skip to content

Commit 5d9cca3

Browse files
committed
feat: dto 변경
1 parent 36b0ea0 commit 5d9cca3

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
package com.waitit.capstone.domain.dashboard.dto;
22

33

4-
import lombok.AllArgsConstructor;
54
import lombok.Getter;
65

76
@Getter
8-
@AllArgsConstructor
97
public class HourlyMetricsQueryResult {
108
private final Long hour;
119
private final Long totalCount;
1210
private final Long enteredCount;
1311
private final Long cancelledCount;
1412

15-
}
13+
public HourlyMetricsQueryResult(Number hour, Number totalCount, Number enteredCount, Number cancelledCount) {
14+
this.hour = hour == null ? null : hour.longValue();
15+
this.totalCount = totalCount == null ? null : totalCount.longValue();
16+
this.enteredCount = enteredCount == null ? null : enteredCount.longValue();
17+
this.cancelledCount = cancelledCount == null ? null : cancelledCount.longValue();
18+
}
19+
}

src/main/java/com/waitit/capstone/domain/dashboard/repository/QueueLogRepository.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ public interface QueueLogRepository extends JpaRepository<QueueLog, Long> {
1919

2020
long countByHostIdAndStatusAndCancelledAtBetween(Long hostId, QueueLog.Status status, LocalDateTime startDate, LocalDateTime endDate);
2121

22-
/**
23-
* [수정] JPQL이 아닌 Native SQL을 사용하도록 변경 (nativeQuery = true)
24-
* - JPQL의 q.registeredAt -> SQL의 q.registered_at 으로 컬럼명 변경
25-
*/
2622
@Query(value = "SELECT AVG(TIMESTAMPDIFF(SECOND, q.registered_at, q.entered_at)) FROM queue_log q " +
2723
"WHERE q.host_id = :hostId AND q.status = 'ENTERED' AND q.entered_at BETWEEN :startDate AND :endDate",
2824
nativeQuery = true)

0 commit comments

Comments
 (0)