Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ namespace O2NetGen.OnTracker.Api.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ValuesController : ControllerBase
public class GeoController : ControllerBase
{
private readonly IGeoIpAddressResolver _geoIpAddressResolver;

public ValuesController(IGeoIpAddressResolver geoIpAddressResolver)
public GeoController(IGeoIpAddressResolver geoIpAddressResolver)
{
_geoIpAddressResolver = geoIpAddressResolver;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"O2.OnTracker.Api": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "api/values",
"launchUrl": "swagger",
"applicationUrl": "https://localhost:57549;http://localhost:43192",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
Expand Down
18 changes: 15 additions & 3 deletions src/Services/on-tracker/O2NextGen.OnTracker.Api/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using O2NetGen.OnTracker.Api.IoC;
using O2NetGen.OnTracker.Api.Setup;
using O2NextGen.Tracker.DbUtility;
using Swashbuckle.AspNetCore.Swagger;

namespace O2NetGen.OnTracker.Api
{
Expand All @@ -22,6 +23,17 @@ public void ConfigureServices(IServiceCollection services)
{
services.AddRequiredMvcComponents();
// services.AddSingleton<IGeoDbSetting, GeoDbSetting>();
services.AddSwaggerGen(options =>
{
options.DescribeAllEnumsAsStrings();
options.SwaggerDoc("v1",new Info()
{
Title = "O2NextGen Platform. On-Tracker HTTP API",
Version = "v1",
Description = "On-Tracker API Service. The service allows you to create certificates",
TermsOfService = "Terms of Service"
});
});
services.ConfigurePOCO<GeoDatabase>(AppConfiguration.GetSection("GeoDatabase"));
services.AddScoped<IGeoIpAddressResolver, MaxMindLocalGeoIpAddressResolver>();
}
Expand All @@ -37,10 +49,10 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseHsts();
}

app.UseSwagger()
.UseSwaggerUI(c => { c.SwaggerEndpoint($"/swagger/v1/swagger.json", "On-Tracker API V1"); });
app.UseHttpsRedirection();
app.UseMvc();
}
}
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>

</Project>
4 changes: 2 additions & 2 deletions src/Services/on-tracker/O2NextGen.OnTracker.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{897A7BA2-3AAB-4D74-BA13-E6AEF977AE98}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "O2NextGen.Tracker.DbUtility", "O2.Tracker.DbUtility\O2NextGen.Tracker.DbUtility.csproj", "{77D9E353-F5AE-440B-8EE8-70EBB92099AD}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "O2NextGen.Tracker.DbUtility", "O2NextGen.Tracker.DbUtility\O2NextGen.Tracker.DbUtility.csproj", "{77D9E353-F5AE-440B-8EE8-70EBB92099AD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "O2NetGen.OnTracker.Api", "O2.OnTracker.Api\O2NetGen.OnTracker.Api.csproj", "{2288664B-04A5-4C80-8685-2AF877F5D335}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "O2NetGen.OnTracker.Api", "O2NextGen.OnTracker.Api\O2NextGen.OnTracker.Api.csproj", "{2288664B-04A5-4C80-8685-2AF877F5D335}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.OnTracker.Data", "O2NextGen.OnTracker.Data\O2NextGen.OnTracker.Data.csproj", "{23CB3AC5-E48E-4A46-B5F7-8FB1F0F00A71}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down