Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,8 @@ public ResponseEntity<?> getLocationCaseStats(@RequestParam("period") String per

// 지도용 장소별 사건 수 조회
@GetMapping("/map")
public ResponseEntity<?> getMapCaseStats(@RequestParam("period") String period, HttpSession session) {
try {
List<MapCaseStatsResponse> stats = caseStatsService.getMapCaseStats(period, session);
return ResponseEntity.ok(stats);
} catch (IllegalStateException e) {
return ResponseEntity.status(401).body(Collections.singletonMap("message", e.getMessage()));
} catch (IllegalArgumentException e) {
return ResponseEntity.status(400).body(Collections.singletonMap("message", e.getMessage()));
} catch (NoSuchElementException e) {
return ResponseEntity.status(404).body(Collections.singletonMap("message", e.getMessage()));
} catch (Exception e) {
return ResponseEntity.status(500).body(Collections.singletonMap("message", "내부 서버 오류가 발생했습니다."));
}
public ResponseEntity<?> getMapCaseStats(HttpSession session) {
List<MapCaseStatsResponse> stats = caseStatsService.getMapCaseStats(session);
return ResponseEntity.ok(stats);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ public List<LocationCaseStatsResponse> getLocationCaseStats(String period, HttpS
}

// 지도용 장소별 사건 수 조회 (startDate를 계산해 전달)
public List<MapCaseStatsResponse> getMapCaseStats(String period, HttpSession session) {
public List<MapCaseStatsResponse> getMapCaseStats(HttpSession session) {
int officeId = getOfficeId(session);

LocalDateTime startDate = getStartDateFromPeriod(period);
LocalDateTime startDate = getStartDateFromPeriod("monthly");
List<Object[]> results = statsCategoryRepository.findMapCaseStats(startDate);

if (results.isEmpty()) {
Expand Down
Loading