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 @@ -2,9 +2,9 @@
using System.Net;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Mvc;
using O2.Tracker.DbUtility;
using O2NextGen.Tracker.DbUtility;

namespace O2.OnTracker.Api.Controllers
namespace O2NetGen.OnTracker.Api.Controllers
{
[Route("api/[controller]")]
[ApiController]
Expand All @@ -29,7 +29,7 @@ public ActionResult Get()
// This usually only happens when the browser is on the same machine as the server.
if (remoteIpAddress.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
{
remoteIpAddress = System.Net.Dns.GetHostEntry(remoteIpAddress).AddressList
remoteIpAddress = Dns.GetHostEntry(remoteIpAddress).AddressList
.First(x => x.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork);
}
result = remoteIpAddress.ToString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace O2.OnTracker.Api.IoC
namespace O2NetGen.OnTracker.Api.IoC
{
public static class ServiceCollectionExtensions
{
Expand Down Expand Up @@ -32,7 +32,7 @@ public static IServiceCollection AddBusiness(this IServiceCollection services)
// services.AddSingleton<IEmailSender, EmailSender>();
return services;
}

public static IServiceCollection AddRequiredMvcComponents(this IServiceCollection services)
{
// services.AddTransient<ApiExceptionFilter>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
using System.Net;
using System.Reflection;
using MaxMind.Db;
using O2.OnTracker.Api.Setup;
using O2.Tracker.DbUtility;
using O2NetGen.OnTracker.Api.Setup;
using O2NextGen.Tracker.DbUtility;

namespace O2.OnTracker.Api
namespace O2NetGen.OnTracker.Api
{
public sealed class MaxMindLocalGeoIpAddressResolver : IGeoIpAddressResolver
{
Expand Down Expand Up @@ -40,17 +40,17 @@ public GeoLocation ResolveAddress(IPAddress ip)
return null;

var result = new GeoLocation
{
Country = response.Country?.Names[DefaultLang],
City = response.City?.Names[DefaultLang]
};
{
Country = response.Country?.Names[DefaultLang],
City = response.City?.Names[DefaultLang]
};
var location = response.Location;
if (location?.HasCoordinates == true)
result.Point = new Point
{
lat = location.Latitude.Value,
lon = location.Longitude.Value
};
{
lat = location.Latitude.Value,
lon = location.Longitude.Value
};

return result;
}
Expand All @@ -66,7 +66,7 @@ protected NamedEntity(

public IReadOnlyDictionary<string, string> Names { get; }
}

private sealed class Country : NamedEntity
{
[Constructor]
Expand All @@ -76,7 +76,7 @@ public Country(
{
}
}

private sealed class Location
{
[Constructor]
Expand All @@ -94,7 +94,7 @@ public Location(

public double? Longitude { get; }
}

private sealed class GeoLocationData
{
[Constructor]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

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

<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\O2.Tracker.DbUtility\O2.Tracker.DbUtility.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="geoip\GeoLite2-City.mmdb">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Remove="geoip\**" />
</ItemGroup>

<ItemGroup>
<Compile Remove="geoip\**" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Remove="geoip\**" />
</ItemGroup>

<ItemGroup>
<Content Remove="geoip\**" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk.Web">

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

<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\O2.Tracker.DbUtility\O2NextGen.Tracker.DbUtility.csproj" />
<ProjectReference Include="..\O2NextGen.OnTracker.Business\O2NextGen.OnTracker.Business.csproj" />
<ProjectReference Include="..\O2NextGen.OnTracker.Data\O2NextGen.OnTracker.Data.csproj" />
<ProjectReference Include="..\O2NextGen.OnTracker.Impl\O2NextGen.OnTracker.Impl.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="geoip\GeoLite2-City.mmdb">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Remove="geoip\**" />
</ItemGroup>

<ItemGroup>
<Compile Remove="geoip\**" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Remove="geoip\**" />
</ItemGroup>

<ItemGroup>
<Content Remove="geoip\**" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Services/on-tracker/O2.OnTracker.Api/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;

namespace O2.OnTracker.Api
namespace O2NetGen.OnTracker.Api
{
public class Program
{
Expand Down
4 changes: 2 additions & 2 deletions src/Services/on-tracker/O2.OnTracker.Api/Setup/GeoDatabase.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace O2.OnTracker.Api.Setup
namespace O2NetGen.OnTracker.Api.Setup
{
public class GeoDatabase
{
public string ConnectionDb { get; set; }
public string ConnectionDb { get; set; }
}
}
8 changes: 4 additions & 4 deletions src/Services/on-tracker/O2.OnTracker.Api/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using O2.OnTracker.Api.IoC;
using O2.OnTracker.Api.Setup;
using O2.Tracker.DbUtility;
using O2NetGen.OnTracker.Api.IoC;
using O2NetGen.OnTracker.Api.Setup;
using O2NextGen.Tracker.DbUtility;

namespace O2.OnTracker.Api
namespace O2NetGen.OnTracker.Api
{
public class Startup
{
Expand Down
36 changes: 0 additions & 36 deletions src/Services/on-tracker/O2.OnTracker.sln

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Runtime.Serialization;

namespace O2.Tracker.DbUtility
namespace O2NextGen.Tracker.DbUtility
{
[DataContract]
public sealed class GeoLocation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Net;

namespace O2.Tracker.DbUtility
namespace O2NextGen.Tracker.DbUtility
{
public interface IGeoIpAddressResolver
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MaxMind.Db" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<None Update="geoip\GeoLite2-City.mmdb">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">

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

<ItemGroup>
<PackageReference Include="MaxMind.Db" Version="3.0.0" />
</ItemGroup>

<ItemGroup>
<None Update="geoip\GeoLite2-City.mmdb">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Services/on-tracker/O2.Tracker.DbUtility/Point.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Runtime.Serialization;

namespace O2.Tracker.DbUtility
namespace O2NextGen.Tracker.DbUtility
{
[DataContract]
public sealed class Point
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace O2NextGen.OnTracker.Business
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

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

</Project>
6 changes: 6 additions & 0 deletions src/Services/on-tracker/O2NextGen.OnTracker.Data/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace O2NextGen.OnTracker.Data
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

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

</Project>
6 changes: 6 additions & 0 deletions src/Services/on-tracker/O2NextGen.OnTracker.Impl/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace O2NextGen.OnTracker.Impl
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

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

</Project>
Loading