|
Last change
on this file was 81cdf2d, checked in by Nikola Janev <nikolajanev57@…>, 9 days ago |
|
initial commit
|
-
Property mode
set to
100644
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | package com.nikola.web3ednevnikbackend.controller;
|
|---|
| 2 |
|
|---|
| 3 | import com.nikola.web3ednevnikbackend.model.procedures.AttendanceReport;
|
|---|
| 4 | import com.nikola.web3ednevnikbackend.model.procedures.AttendanceReportResponse;
|
|---|
| 5 | import com.nikola.web3ednevnikbackend.repository.triggers.FailedLoginReport;
|
|---|
| 6 | import org.springframework.web.bind.annotation.GetMapping;
|
|---|
| 7 | import org.springframework.web.bind.annotation.RequestMapping;
|
|---|
| 8 | import org.springframework.web.bind.annotation.RestController;
|
|---|
| 9 |
|
|---|
| 10 | import java.time.LocalDate;
|
|---|
| 11 | import java.util.List;
|
|---|
| 12 |
|
|---|
| 13 | @RestController
|
|---|
| 14 | @RequestMapping("/api/failedLoginReport")
|
|---|
| 15 | public class FailedLoginController {
|
|---|
| 16 |
|
|---|
| 17 | private final FailedLoginReport failedLoginReport;
|
|---|
| 18 |
|
|---|
| 19 | public FailedLoginController(FailedLoginReport failedLoginReport) {
|
|---|
| 20 | this.failedLoginReport = failedLoginReport;
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | @GetMapping
|
|---|
| 24 | public List<com.nikola.web3ednevnikbackend.model.FailedLoginReport> getReports() {
|
|---|
| 25 | List<com.nikola.web3ednevnikbackend.model.FailedLoginReport> failedLoginReports = this.failedLoginReport.findAllReports();
|
|---|
| 26 | if(failedLoginReports.isEmpty()){
|
|---|
| 27 | // throw new IllegalArgumentException("No reports found");
|
|---|
| 28 | return null;
|
|---|
| 29 | }
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 | return failedLoginReports;
|
|---|
| 33 | }
|
|---|
| 34 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.