From cd7d1b3096f314b4768147f46f29b106b4db1e90 Mon Sep 17 00:00:00 2001 From: Mark van der Wal Date: Wed, 8 Apr 2020 20:39:38 +0200 Subject: [PATCH] Created separate project for herbicide --- FarmmapsApiSamples.sln | 6 ++++ .../Data}/Lutum.tiff | Bin .../Data}/vd_born_lutum.zip | Bin .../Data}/vd_born_om.zip | Bin FarmmapsHerbicide/FarmmapsHerbicide.csproj | 20 +++++++++++ FarmmapsHerbicide/HerbicideApplication.cs | 31 ++++++++++++++++++ .../HerbicideService.cs | 0 .../Models/HerbicideAgent.cs | 0 FarmmapsHerbicide/Program.cs | 24 ++++++++++++++ FarmmapsHerbicide/appsettings.json | 10 ++++++ .../Data/{Nbs => }/Scan_1_20190605.zip | Bin FarmmapsNbs/NbsApplication.cs | 3 +- FarmmapsNbs/NitrogenService.cs | 6 +--- FarmmapsNbs/Program.cs | 2 +- 14 files changed, 94 insertions(+), 8 deletions(-) rename {FarmmapsNbs/Data/Herbicide => FarmmapsHerbicide/Data}/Lutum.tiff (100%) rename {FarmmapsNbs/Data/Herbicide => FarmmapsHerbicide/Data}/vd_born_lutum.zip (100%) rename {FarmmapsNbs/Data/Herbicide => FarmmapsHerbicide/Data}/vd_born_om.zip (100%) create mode 100644 FarmmapsHerbicide/FarmmapsHerbicide.csproj create mode 100644 FarmmapsHerbicide/HerbicideApplication.cs rename {FarmmapsNbs => FarmmapsHerbicide}/HerbicideService.cs (100%) rename {FarmmapsNbs => FarmmapsHerbicide}/Models/HerbicideAgent.cs (100%) create mode 100644 FarmmapsHerbicide/Program.cs create mode 100644 FarmmapsHerbicide/appsettings.json rename FarmmapsNbs/Data/{Nbs => }/Scan_1_20190605.zip (100%) diff --git a/FarmmapsApiSamples.sln b/FarmmapsApiSamples.sln index 68a518c..5573bb0 100644 --- a/FarmmapsApiSamples.sln +++ b/FarmmapsApiSamples.sln @@ -10,6 +10,8 @@ ProjectSection(SolutionItems) = preProject .gitignore = .gitignore EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FarmmapsHerbicide", "FarmmapsHerbicide\FarmmapsHerbicide.csproj", "{731A88CD-9DC4-4969-86F2-2315830A6998}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -24,5 +26,9 @@ Global {1FA9E50B-F45E-4534-953A-37C783D03C74}.Debug|Any CPU.Build.0 = Debug|Any CPU {1FA9E50B-F45E-4534-953A-37C783D03C74}.Release|Any CPU.ActiveCfg = Release|Any CPU {1FA9E50B-F45E-4534-953A-37C783D03C74}.Release|Any CPU.Build.0 = Release|Any CPU + {731A88CD-9DC4-4969-86F2-2315830A6998}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {731A88CD-9DC4-4969-86F2-2315830A6998}.Debug|Any CPU.Build.0 = Debug|Any CPU + {731A88CD-9DC4-4969-86F2-2315830A6998}.Release|Any CPU.ActiveCfg = Release|Any CPU + {731A88CD-9DC4-4969-86F2-2315830A6998}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/FarmmapsNbs/Data/Herbicide/Lutum.tiff b/FarmmapsHerbicide/Data/Lutum.tiff similarity index 100% rename from FarmmapsNbs/Data/Herbicide/Lutum.tiff rename to FarmmapsHerbicide/Data/Lutum.tiff diff --git a/FarmmapsNbs/Data/Herbicide/vd_born_lutum.zip b/FarmmapsHerbicide/Data/vd_born_lutum.zip similarity index 100% rename from FarmmapsNbs/Data/Herbicide/vd_born_lutum.zip rename to FarmmapsHerbicide/Data/vd_born_lutum.zip diff --git a/FarmmapsNbs/Data/Herbicide/vd_born_om.zip b/FarmmapsHerbicide/Data/vd_born_om.zip similarity index 100% rename from FarmmapsNbs/Data/Herbicide/vd_born_om.zip rename to FarmmapsHerbicide/Data/vd_born_om.zip diff --git a/FarmmapsHerbicide/FarmmapsHerbicide.csproj b/FarmmapsHerbicide/FarmmapsHerbicide.csproj new file mode 100644 index 0000000..5e79ae2 --- /dev/null +++ b/FarmmapsHerbicide/FarmmapsHerbicide.csproj @@ -0,0 +1,20 @@ + + + + Exe + netcoreapp3.0 + + + + + Always + + + Always + + + + + + + diff --git a/FarmmapsHerbicide/HerbicideApplication.cs b/FarmmapsHerbicide/HerbicideApplication.cs new file mode 100644 index 0000000..68296c7 --- /dev/null +++ b/FarmmapsHerbicide/HerbicideApplication.cs @@ -0,0 +1,31 @@ +using System.Threading.Tasks; +using FarmmapsApi; +using FarmmapsApi.Services; +using FarmmapsApiSamples; +using Microsoft.Extensions.Logging; + +namespace FarmmapsHerbicide +{ + public class HerbicideApplication : IApplication + { + private const string DownloadFolder = "Downloads"; + + private readonly ILogger _logger; + private readonly FarmmapsApiService _farmmapsApiService; + private readonly HerbicideService _herbicideService; + private readonly GeneralService _generalService; + + public HerbicideApplication(ILogger logger, FarmmapsApiService farmmapsApiService, + GeneralService generalService, HerbicideService herbicideService) + { + _logger = logger; + _farmmapsApiService = farmmapsApiService; + _generalService = generalService; + _herbicideService = herbicideService; + } + + public async Task RunAsync() + { + } + } +} \ No newline at end of file diff --git a/FarmmapsNbs/HerbicideService.cs b/FarmmapsHerbicide/HerbicideService.cs similarity index 100% rename from FarmmapsNbs/HerbicideService.cs rename to FarmmapsHerbicide/HerbicideService.cs diff --git a/FarmmapsNbs/Models/HerbicideAgent.cs b/FarmmapsHerbicide/Models/HerbicideAgent.cs similarity index 100% rename from FarmmapsNbs/Models/HerbicideAgent.cs rename to FarmmapsHerbicide/Models/HerbicideAgent.cs diff --git a/FarmmapsHerbicide/Program.cs b/FarmmapsHerbicide/Program.cs new file mode 100644 index 0000000..1609f86 --- /dev/null +++ b/FarmmapsHerbicide/Program.cs @@ -0,0 +1,24 @@ +using System.Threading.Tasks; +using FarmmapsApi; +using FarmmapsApiSamples; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace FarmmapsHerbicide +{ + class Program : FarmmapsProgram + { + private static async Task Main(string[] args) + { + await new Program().Start(args); + } + + protected override void Configure(IServiceCollection serviceCollection) + { + serviceCollection.AddLogging(opts => opts + .AddConsole() + .AddFilter("System.Net.Http", LogLevel.Warning)) + .AddTransient(); + } + } +} \ No newline at end of file diff --git a/FarmmapsHerbicide/appsettings.json b/FarmmapsHerbicide/appsettings.json new file mode 100644 index 0000000..caeb12c --- /dev/null +++ b/FarmmapsHerbicide/appsettings.json @@ -0,0 +1,10 @@ +{ + "Authority": "https://accounts.farmmaps.awtest.nl/", + "Endpoint": "https://farmmaps.awtest.nl/", + "BasePath": "api/v1", + "DiscoveryEndpointUrl": "https://accounts.farmmaps.awtest.nl/.well-known/openid-configuration", + "RedirectUri": "http://example.nl/api", + "ClientId": "", + "ClientSecret": "", + "Scopes": ["api"] +} \ No newline at end of file diff --git a/FarmmapsNbs/Data/Nbs/Scan_1_20190605.zip b/FarmmapsNbs/Data/Scan_1_20190605.zip similarity index 100% rename from FarmmapsNbs/Data/Nbs/Scan_1_20190605.zip rename to FarmmapsNbs/Data/Scan_1_20190605.zip diff --git a/FarmmapsNbs/NbsApplication.cs b/FarmmapsNbs/NbsApplication.cs index 92ae961..34c5bf4 100644 --- a/FarmmapsNbs/NbsApplication.cs +++ b/FarmmapsNbs/NbsApplication.cs @@ -6,7 +6,7 @@ using FarmmapsApi; using FarmmapsApi.Services; using Microsoft.Extensions.Logging; -namespace FarmmapsApiSamples +namespace FarmmapsNbs { public class NbsApplication : IApplication { @@ -14,7 +14,6 @@ namespace FarmmapsApiSamples private readonly ILogger _logger; private readonly FarmmapsApiService _farmmapsApiService; - private readonly FarmmapsEventHub _farmmapsEventHub; private readonly NitrogenService _nitrogenService; private readonly GeneralService _generalService; diff --git a/FarmmapsNbs/NitrogenService.cs b/FarmmapsNbs/NitrogenService.cs index e3d9aad..ce90d39 100644 --- a/FarmmapsNbs/NitrogenService.cs +++ b/FarmmapsNbs/NitrogenService.cs @@ -1,17 +1,13 @@ using System; -using System.Collections.Generic; using System.Globalization; -using System.IO; -using System.Linq; using System.Threading.Tasks; using FarmmapsApi.Models; using FarmmapsApi.Services; using Microsoft.Extensions.Logging; -using Newtonsoft.Json.Linq; using static FarmmapsApi.Extensions; using static FarmmapsApiSamples.Constants; -namespace FarmmapsApiSamples +namespace FarmmapsNbs { public class NitrogenService { diff --git a/FarmmapsNbs/Program.cs b/FarmmapsNbs/Program.cs index c5b398b..596637a 100644 --- a/FarmmapsNbs/Program.cs +++ b/FarmmapsNbs/Program.cs @@ -3,7 +3,7 @@ using FarmmapsApi; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -namespace FarmmapsApiSamples +namespace FarmmapsNbs { class Program : FarmmapsProgram {