Last change
on this file since 9868304 was a70b5a4, checked in by ste08 <sjovanoska@…>, 4 months ago |
Report added
|
-
Property mode
set to
100644
|
File size:
918 bytes
|
Line | |
---|
1 | package com.example.skychasemk.controller;
|
---|
2 |
|
---|
3 | import com.example.skychasemk.model.TopMonthlyReport;
|
---|
4 | import com.example.skychasemk.services.TopMonthlyReportService;
|
---|
5 | import org.springframework.beans.factory.annotation.Autowired;
|
---|
6 | import org.springframework.web.bind.annotation.*;
|
---|
7 |
|
---|
8 | import java.time.LocalDate;
|
---|
9 | import java.util.List;
|
---|
10 |
|
---|
11 | @RestController
|
---|
12 | @RequestMapping("/api/reports")
|
---|
13 | @CrossOrigin("*")
|
---|
14 | public 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.