source: backend/src/main/java/mk/finki/roomreservation/controller/DashboardController.java@ 09e02d7

Last change on this file since 09e02d7 was 09e02d7, checked in by Nikola Sarafimov <sarafimov.nikola12345@…>, 3 days ago

Final room reservation system implementation

  • Property mode set to 100644
File size: 813 bytes
Line 
1package mk.finki.roomreservation.controller;
2
3import mk.finki.roomreservation.model.DashboardStats;
4import mk.finki.roomreservation.model.HealthStatus;
5import mk.finki.roomreservation.service.DashboardService;
6import org.springframework.web.bind.annotation.GetMapping;
7import org.springframework.web.bind.annotation.RestController;
8
9@RestController
10public class DashboardController {
11
12 private final DashboardService dashboardService;
13
14 public DashboardController(DashboardService dashboardService) {
15 this.dashboardService = dashboardService;
16 }
17
18 @GetMapping("/api/health")
19 public HealthStatus health() {
20 return dashboardService.health();
21 }
22
23 @GetMapping("/api/dashboard")
24 public DashboardStats dashboard() {
25 return dashboardService.getDashboardStats();
26 }
27}
Note: See TracBrowser for help on using the repository browser.