-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from davewalker5/sighting-statistics-report
Sighting statistics report
- Loading branch information
Showing
26 changed files
with
234 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM mcr.microsoft.com/dotnet/core/aspnet:latest | ||
COPY flightrecorder.api-1.10.0.0 /opt/flightrecorder.api-1.10.0.0 | ||
WORKDIR /opt/flightrecorder.api-1.10.0.0/bin | ||
COPY flightrecorder.api-1.11.0.0 /opt/flightrecorder.api-1.11.0.0 | ||
WORKDIR /opt/flightrecorder.api-1.11.0.0/bin | ||
ENTRYPOINT [ "./FlightRecorder.Api" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM mcr.microsoft.com/dotnet/aspnet:latest AS runtime | ||
COPY flightrecorder.mvc-1.10.0.0 /opt/flightrecorder.mvc-1.10.0.0 | ||
WORKDIR /opt/flightrecorder.mvc-1.10.0.0/bin | ||
COPY flightrecorder.mvc-1.11.0.0 /opt/flightrecorder.mvc-1.11.0.0 | ||
WORKDIR /opt/flightrecorder.mvc-1.11.0.0/bin | ||
ENTRYPOINT [ "./FlightRecorder.Mvc" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/FlightRecorder.Api/Entities/SightingStatisticsReport.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace FlightRecorder.Api.Entities | ||
{ | ||
[ExcludeFromCodeCoverage] | ||
public record SightingStatisticsReport | ||
( | ||
int Aircraft, | ||
int Manufacturers, | ||
int Models, | ||
int Airlines, | ||
int Flights, | ||
int Sightings, | ||
int Locations | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/FlightRecorder.Mvc/Controllers/SightingStatisticsController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using FlightRecorder.Mvc.Api; | ||
using FlightRecorder.Mvc.Configuration; | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Extensions.Options; | ||
|
||
namespace FlightRecorder.Mvc.Controllers | ||
{ | ||
[Authorize] | ||
public class SightingStatisticsController : Controller | ||
{ | ||
private readonly ReportsClient _reportsClient; | ||
private readonly IOptions<AppSettings> _settings; | ||
|
||
public SightingStatisticsController( | ||
ReportsClient reportsClient, | ||
IOptions<AppSettings> settings) | ||
{ | ||
_reportsClient = reportsClient; | ||
_settings = settings; | ||
} | ||
|
||
/// <summary> | ||
/// Retrieve and serve the report | ||
/// </summary> | ||
/// <returns></returns> | ||
[HttpGet] | ||
public async Task<IActionResult> Index() | ||
{ | ||
var report = await _reportsClient.SightingStatisticsAsync(); | ||
return View(report); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace FlightRecorder.Mvc.Entities | ||
{ | ||
public record SightingStatistics | ||
( | ||
int Aircraft, | ||
int Manufacturers, | ||
int Models, | ||
int Airlines, | ||
int Flights, | ||
int Sightings, | ||
int Locations | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.