source: src/main/java/com/example/skychasemk/controller/TopMonthlyReportController.java@ de83113

Last change on this file since de83113 was a70b5a4, checked in by ste08 <sjovanoska@…>, 4 months ago

Report added

  • Property mode set to 100644
File size: 918 bytes
Line 
1package com.example.skychasemk.controller;
2
3import com.example.skychasemk.model.TopMonthlyReport;
4import com.example.skychasemk.services.TopMonthlyReportService;
5import org.springframework.beans.factory.annotation.Autowired;
6import org.springframework.web.bind.annotation.*;
7
8import java.time.LocalDate;
9import java.util.List;
10
11@RestController
12@RequestMapping("/api/reports")
13@CrossOrigin("*")
14public class TopMonthlyReportController {
15 @Autowired
16 private TopMonthlyReportService service;
17 @GetMapping
18 public String getReportsPage() {
19 return "TopMonthlyReport";
20 }
21
22 @GetMapping("/top-monthly")
23 public List<TopMonthlyReport> getAllReports() {
24 return service.getAllReports();
25 }
26
27 @GetMapping("/top-monthly/{month}")
28 public List<TopMonthlyReport> getReportsByMonth(@PathVariable String month) {
29 return service.getReportsByMonth(LocalDate.parse(month));
30 }
31}
Note: See TracBrowser for help on using the repository browser.