diff --git a/src/Services/id-portal/O2Bionics.Services.IdPortal.sln b/src/Services/id-portal/O2Bionics.Services.IdPortal.sln new file mode 100644 index 00000000..7d363a6d --- /dev/null +++ b/src/Services/id-portal/O2Bionics.Services.IdPortal.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33213.308 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2Bionics.Services.IdPortal", "src\O2Bionics.Services.IdPortal\O2Bionics.Services.IdPortal.csproj", "{1657073E-9EE7-43D3-A3FD-A32025E57488}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1657073E-9EE7-43D3-A3FD-A32025E57488}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1657073E-9EE7-43D3-A3FD-A32025E57488}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1657073E-9EE7-43D3-A3FD-A32025E57488}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1657073E-9EE7-43D3-A3FD-A32025E57488}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8AD066DD-B55F-49B5-8D69-6C076266C1B7} + EndGlobalSection +EndGlobal diff --git a/src/Services/id-portal/src/O2Bionics.Services.IdPortal/Controllers/VersionController.cs b/src/Services/id-portal/src/O2Bionics.Services.IdPortal/Controllers/VersionController.cs new file mode 100644 index 00000000..0377a1f3 --- /dev/null +++ b/src/Services/id-portal/src/O2Bionics.Services.IdPortal/Controllers/VersionController.cs @@ -0,0 +1,40 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System.Reflection; + +namespace O2Bionics.Services.IdPortal.Controllers +{ + [AllowAnonymous] + public class VersionController : ControllerBase + { + #region Fields + + private readonly IWebHostEnvironment _environment; + private readonly ILogger _logger; + + #endregion + + + #region Ctors + + public VersionController(IWebHostEnvironment environment, ILogger logger) + { + _environment = environment; + _logger = logger; + } + + #endregion + + [HttpGet("[controller]")] + public object Index() + { + var exVersion = Assembly.GetExecutingAssembly().GetName().Version; + _logger.LogInformation($"get version - {exVersion}"); + return new + { + Environment = _environment.EnvironmentName, + Version = exVersion?.ToString() + }; + } + } +} diff --git a/src/Services/id-portal/src/O2Bionics.Services.IdPortal/O2Bionics.Services.IdPortal.csproj b/src/Services/id-portal/src/O2Bionics.Services.IdPortal/O2Bionics.Services.IdPortal.csproj new file mode 100644 index 00000000..bfb07bc7 --- /dev/null +++ b/src/Services/id-portal/src/O2Bionics.Services.IdPortal/O2Bionics.Services.IdPortal.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/Services/id-portal/src/O2Bionics.Services.IdPortal/Program.cs b/src/Services/id-portal/src/O2Bionics.Services.IdPortal/Program.cs new file mode 100644 index 00000000..5c2eb32e --- /dev/null +++ b/src/Services/id-portal/src/O2Bionics.Services.IdPortal/Program.cs @@ -0,0 +1,30 @@ +var builder = WebApplication.CreateBuilder(args); +var configuration = builder.Configuration; +var environment = builder.Environment; + +// Add services to the container. +builder.Services.AddControllers(); +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); +app.UseSwagger(); +app.UseSwaggerUI(); +app.Use(async (context, next) => +{ + context.Response.OnStarting(() => + { + context.Response.Headers.Add("X-Powered-By", "O2NextGen Platform"); + return Task.CompletedTask; + }); + + await next.Invoke(); +}); +app.UseRouting(); +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/src/Services/id-portal/src/O2Bionics.Services.IdPortal/Properties/launchSettings.json b/src/Services/id-portal/src/O2Bionics.Services.IdPortal/Properties/launchSettings.json new file mode 100644 index 00000000..ff6d3649 --- /dev/null +++ b/src/Services/id-portal/src/O2Bionics.Services.IdPortal/Properties/launchSettings.json @@ -0,0 +1,28 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:16044", + "sslPort": 0 + } + }, + "profiles": { + "O2Bionics.Services.IdPortal": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:5160", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/src/Services/id-portal/src/O2Bionics.Services.IdPortal/appsettings.Development.json b/src/Services/id-portal/src/O2Bionics.Services.IdPortal/appsettings.Development.json new file mode 100644 index 00000000..ff66ba6b --- /dev/null +++ b/src/Services/id-portal/src/O2Bionics.Services.IdPortal/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/src/Services/id-portal/src/O2Bionics.Services.IdPortal/appsettings.json b/src/Services/id-portal/src/O2Bionics.Services.IdPortal/appsettings.json new file mode 100644 index 00000000..4d566948 --- /dev/null +++ b/src/Services/id-portal/src/O2Bionics.Services.IdPortal/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/src/Services/id-portal/src/O2Bionics.Services.IdPortal/libman.json b/src/Services/id-portal/src/O2Bionics.Services.IdPortal/libman.json new file mode 100644 index 00000000..b0b3b9a4 --- /dev/null +++ b/src/Services/id-portal/src/O2Bionics.Services.IdPortal/libman.json @@ -0,0 +1,5 @@ +{ + "version": "1.0", + "defaultProvider": "cdnjs", + "libraries": [] +} \ No newline at end of file diff --git a/src/WebApps/PFRCentr.Mvc/src/PFRCentr.App.MvcClient/Controllers/CategoryController.cs b/src/WebApps/PFRCentr.Mvc/src/PFRCentr.App.MvcClient/Controllers/CategoryController.cs index 5f89af4c..267c6801 100644 --- a/src/WebApps/PFRCentr.Mvc/src/PFRCentr.App.MvcClient/Controllers/CategoryController.cs +++ b/src/WebApps/PFRCentr.Mvc/src/PFRCentr.App.MvcClient/Controllers/CategoryController.cs @@ -5,6 +5,7 @@ namespace PFRCentr.App.MvcClient.Controllers; +// [Authorize] public class CategoryController:Controller { private readonly ICGenCategoryService _icGenCategoryService; diff --git a/src/WebApps/PFRCentr.Mvc/src/PFRCentr.App.MvcClient/appsettings.Development.json b/src/WebApps/PFRCentr.Mvc/src/PFRCentr.App.MvcClient/appsettings.Development.json index 8f3cb3ac..8db9a916 100644 --- a/src/WebApps/PFRCentr.Mvc/src/PFRCentr.App.MvcClient/appsettings.Development.json +++ b/src/WebApps/PFRCentr.Mvc/src/PFRCentr.App.MvcClient/appsettings.Development.json @@ -6,8 +6,8 @@ } }, "Services": { -// "CallBackUrl":"https://localhost:5003", -// "AuthApiUrl": "https://localhost:5000", - "CGenApiUrl":"https://localhost:11001" + "CallBackUrl":"https://localhost:5003", + "AuthApiUrl": "https://auth.o2nextgen.com", + "CGenApiUrl":"https://cgen-api.o2nextgen.com" } } diff --git a/src/WebApps/PFRCentr.Mvc/src/PFRCentr.App.MvcClient/appsettings.json b/src/WebApps/PFRCentr.Mvc/src/PFRCentr.App.MvcClient/appsettings.json index 3e5226c0..2bae6c51 100644 --- a/src/WebApps/PFRCentr.Mvc/src/PFRCentr.App.MvcClient/appsettings.json +++ b/src/WebApps/PFRCentr.Mvc/src/PFRCentr.App.MvcClient/appsettings.json @@ -8,7 +8,10 @@ "AllowedHosts": "*", "Services": { "CallBackUrl":"https://localhost:5003", - "AuthApiUrl": "https://localhost:5000", - "CGenApiUrl":"https://localhost:11001" + "AuthApiUrl": "https://auth.o2nextgen.com", + "CGenApiUrl":"https://cgen-api.o2nextgen.com" +// "CallBackUrl":"https://localhost:5003", +// "AuthApiUrl": "https://localhost:5000", +// "CGenApiUrl":"https://localhost:11001" } }