-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76e1b68
commit 863255d
Showing
20 changed files
with
238 additions
and
37 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
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 droneflightlog.mvc-1.1.4.0 /opt/droneflightlog.mvc-1.1.4.0 | ||
WORKDIR /opt/droneflightlog.mvc-1.1.4.0/bin | ||
COPY droneflightlog.mvc-1.2.0.0 /opt/droneflightlog.mvc-1.2.0.0 | ||
WORKDIR /opt/droneflightlog.mvc-1.2.0.0/bin | ||
ENTRYPOINT [ "./DroneFlightLog.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
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
2 changes: 2 additions & 0 deletions
2
src/DroneFlightLog.Data/Binders/MaintenanceRecordTypeJsonConverter.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,37 @@ | ||
namespace DroneFlightLog.Mvc.Api | ||
using DroneFlightLog.Mvc.Configuration; | ||
using DroneFlightLog.Mvc.Entities; | ||
using DroneFlightLog.Mvc.Interfaces; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.Extensions.Options; | ||
using Newtonsoft.Json; | ||
using System.Linq; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
|
||
namespace DroneFlightLog.Mvc.Api | ||
{ | ||
public class MaintenanceRecordClient | ||
public class MaintenanceRecordClient : DroneFlightLogClientBase | ||
{ | ||
private const string RouteKey = "MaintenanceRecords"; | ||
private const string CacheKey = "MaintenanceRecords"; | ||
|
||
public MaintenanceRecordClient(HttpClient client, IOptions<AppSettings> settings, IHttpContextAccessor accessor, ICacheWrapper cache) | ||
: base(client, settings, accessor, cache) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Retrieve a single maintenance record given its ID | ||
/// </summary> | ||
/// <param name="recordId"></param> | ||
/// <returns></returns> | ||
public async Task<MaintenanceRecord> GetMaintenanceRecordAsync(int recordId) | ||
{ | ||
string baseRoute = _settings.Value.ApiRoutes.First(r => r.Name == RouteKey).Route; | ||
string route = $"{baseRoute}/{recordId}"; | ||
string json = await SendDirectAsync(route, null, HttpMethod.Get); | ||
MaintenanceRecord maintenanceRecord = JsonConvert.DeserializeObject<MaintenanceRecord>(json); | ||
return maintenanceRecord; | ||
} | ||
} | ||
} |
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.