-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSystemLogController.java
More file actions
31 lines (28 loc) · 1.49 KB
/
SystemLogController.java
File metadata and controls
31 lines (28 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.factoreal.backend.controller;
import com.factoreal.backend.dto.abnormalLog.AbnormalPagingDto;
import com.factoreal.backend.dto.abnormalLog.SystemLogResponseDto;
import com.factoreal.backend.service.AbnormalLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@Tag(name = "시스템 로그 API", description = "공간별 시스템 로그 조회 API")
@RestController
@RequestMapping("/api/system-logs")
@RequiredArgsConstructor
public class SystemLogController {
private final AbnormalLogService abnormalLogService;
@Operation(summary = "공간별 시스템 로그 조회", description = "특정 공간(zone)의 시스템 로그를 페이징 처리하여 조회합니다.")
@GetMapping("/zone/{zoneId}")
public ResponseEntity<Page<SystemLogResponseDto>> getSystemLogsByZone(
@Parameter(description = "조회할 공간 ID", required = true)
@PathVariable String zoneId,
@Parameter(description = "페이징 정보 (page: 페이지 번호, size: 페이지 크기)")
@ModelAttribute AbnormalPagingDto pagingDto) {
Page<SystemLogResponseDto> logs = abnormalLogService.findSystemLogsByZoneId(zoneId, pagingDto);
return ResponseEntity.ok(logs);
}
}