From 6fc137cc29e8e3415998de6a512712d87c9519b5 Mon Sep 17 00:00:00 2001 From: Denis Prokhorchik Date: Sun, 9 Jan 2022 13:48:47 +0300 Subject: [PATCH 1/5] feat(issue-126): add api gateway for backend-to-frontend of web version --- src/ApiGateways/O2NextGen.ApiGateway.sln | 17 +++++++ .../O2NextGen.Web.BFF.Core.sln | 25 ++++++++++ .../Controllers/ValuesController.cs | 46 ++++++++++++++++++ .../O2NextGen.Web.BFF.Core.csproj | 16 +++++++ .../O2NextGen.Web.BFF.Core/Program.cs | 25 ++++++++++ .../Properties/launchSettings.json | 31 ++++++++++++ .../O2NextGen.Web.BFF.Core/Startup.cs | 48 +++++++++++++++++++ .../appsettings.Development.json | 10 ++++ .../O2NextGen.Web.BFF.Core/appsettings.json | 9 ++++ 9 files changed, 227 insertions(+) create mode 100644 src/ApiGateways/O2NextGen.ApiGateway.sln create mode 100644 src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core.sln create mode 100644 src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Controllers/ValuesController.cs create mode 100644 src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core.csproj create mode 100644 src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Program.cs create mode 100644 src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Properties/launchSettings.json create mode 100644 src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Startup.cs create mode 100644 src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/appsettings.Development.json create mode 100644 src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/appsettings.json diff --git a/src/ApiGateways/O2NextGen.ApiGateway.sln b/src/ApiGateways/O2NextGen.ApiGateway.sln new file mode 100644 index 00000000..5c535c46 --- /dev/null +++ b/src/ApiGateways/O2NextGen.ApiGateway.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 25.0.1700.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C85BA32B-7971-4292-AA04-8F8B90743E8E} + EndGlobalSection +EndGlobal diff --git a/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core.sln b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core.sln new file mode 100644 index 00000000..31d4c301 --- /dev/null +++ b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 25.0.1700.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.Web.BFF.Core", "O2NextGen.Web.BFF.Core\O2NextGen.Web.BFF.Core.csproj", "{ED553F89-6C2C-48BA-8937-B597A421118E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ED553F89-6C2C-48BA-8937-B597A421118E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ED553F89-6C2C-48BA-8937-B597A421118E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ED553F89-6C2C-48BA-8937-B597A421118E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ED553F89-6C2C-48BA-8937-B597A421118E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {53512CC3-EAC0-4BD6-BDE5-E58683B423CC} + EndGlobalSection +EndGlobal diff --git a/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Controllers/ValuesController.cs b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Controllers/ValuesController.cs new file mode 100644 index 00000000..80788fcb --- /dev/null +++ b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Controllers/ValuesController.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace O2NextGen.Web.BFF.Core.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class ValuesController : ControllerBase + { + // GET api/values + [HttpGet] + public ActionResult> Get() + { + return new string[] { "value1", "value2" }; + } + + // GET api/values/5 + [HttpGet("{id}")] + public ActionResult Get(int id) + { + return "value"; + } + + // POST api/values + [HttpPost] + public void Post([FromBody] string value) + { + } + + // PUT api/values/5 + [HttpPut("{id}")] + public void Put(int id, [FromBody] string value) + { + } + + // DELETE api/values/5 + [HttpDelete("{id}")] + public void Delete(int id) + { + } + } +} + diff --git a/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core.csproj b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core.csproj new file mode 100644 index 00000000..e7a1cb80 --- /dev/null +++ b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core.csproj @@ -0,0 +1,16 @@ + + + + netcoreapp2.1 + + + + + + + + + + + + diff --git a/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Program.cs b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Program.cs new file mode 100644 index 00000000..ac1ab2a9 --- /dev/null +++ b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Program.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace O2NextGen.Web.BFF.Core +{ + public class Program + { + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} + diff --git a/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Properties/launchSettings.json b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Properties/launchSettings.json new file mode 100644 index 00000000..8541d245 --- /dev/null +++ b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Properties/launchSettings.json @@ -0,0 +1,31 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:41774", + "sslPort": 44379 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "api/values", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "O2NextGen.Web.BFF.Core": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "api/values", + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} + diff --git a/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Startup.cs b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Startup.cs new file mode 100644 index 00000000..6350818d --- /dev/null +++ b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/Startup.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.HttpsPolicy; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace O2NextGen.Web.BFF.Core +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseMvc(); + } + } +} + diff --git a/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/appsettings.Development.json b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/appsettings.Development.json new file mode 100644 index 00000000..11a51145 --- /dev/null +++ b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/appsettings.Development.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} + diff --git a/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/appsettings.json b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/appsettings.json new file mode 100644 index 00000000..013120d6 --- /dev/null +++ b/src/ApiGateways/O2NextGen.Web.BFF.Core/O2NextGen.Web.BFF.Core/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} + From acb28dc1a8d36f22bf9fe02b9640b709daef7d83 Mon Sep 17 00:00:00 2001 From: Denis Prokhorchik Date: Sun, 9 Jan 2022 13:51:59 +0300 Subject: [PATCH 2/5] feat(issue-127): add api gateway for backend-to-frontend of mobile version --- .../O2NextGen.Mobile.BFF.Core.sln | 25 ++++++++++ .../Controllers/ValuesController.cs | 46 ++++++++++++++++++ .../O2NextGen.Mobile.BFF.Core.csproj | 16 +++++++ .../O2NextGen.Mobile.BFF.Core/Program.cs | 25 ++++++++++ .../Properties/launchSettings.json | 31 ++++++++++++ .../O2NextGen.Mobile.BFF.Core/Startup.cs | 48 +++++++++++++++++++ .../appsettings.Development.json | 10 ++++ .../appsettings.json | 9 ++++ 8 files changed, 210 insertions(+) create mode 100644 src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.sln create mode 100644 src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Controllers/ValuesController.cs create mode 100644 src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj create mode 100644 src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Program.cs create mode 100644 src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Properties/launchSettings.json create mode 100644 src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Startup.cs create mode 100644 src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/appsettings.Development.json create mode 100644 src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/appsettings.json diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.sln b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.sln new file mode 100644 index 00000000..6f39e607 --- /dev/null +++ b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 25.0.1700.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.Mobile.BFF.Core", "O2NextGen.Mobile.BFF.Core\O2NextGen.Mobile.BFF.Core.csproj", "{48CD18D1-12AD-4114-A22C-5A18ADB1989C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {48CD18D1-12AD-4114-A22C-5A18ADB1989C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {48CD18D1-12AD-4114-A22C-5A18ADB1989C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {48CD18D1-12AD-4114-A22C-5A18ADB1989C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {48CD18D1-12AD-4114-A22C-5A18ADB1989C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0697DC00-F6C0-4E2B-9542-AEE4FFE51C3B} + EndGlobalSection +EndGlobal diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Controllers/ValuesController.cs b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Controllers/ValuesController.cs new file mode 100644 index 00000000..09f5cbed --- /dev/null +++ b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Controllers/ValuesController.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace O2NextGen.Mobile.BFF.Core.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class ValuesController : ControllerBase + { + // GET api/values + [HttpGet] + public ActionResult> Get() + { + return new string[] { "value1", "value2" }; + } + + // GET api/values/5 + [HttpGet("{id}")] + public ActionResult Get(int id) + { + return "value"; + } + + // POST api/values + [HttpPost] + public void Post([FromBody] string value) + { + } + + // PUT api/values/5 + [HttpPut("{id}")] + public void Put(int id, [FromBody] string value) + { + } + + // DELETE api/values/5 + [HttpDelete("{id}")] + public void Delete(int id) + { + } + } +} + diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj new file mode 100644 index 00000000..e7a1cb80 --- /dev/null +++ b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj @@ -0,0 +1,16 @@ + + + + netcoreapp2.1 + + + + + + + + + + + + diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Program.cs b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Program.cs new file mode 100644 index 00000000..d08604d7 --- /dev/null +++ b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Program.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace O2NextGen.Mobile.BFF.Core +{ + public class Program + { + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} + diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Properties/launchSettings.json b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Properties/launchSettings.json new file mode 100644 index 00000000..3aaa3363 --- /dev/null +++ b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Properties/launchSettings.json @@ -0,0 +1,31 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:38657", + "sslPort": 44375 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "api/values", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "O2NextGen.Mobile.BFF.Core": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "api/values", + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} + diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Startup.cs b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Startup.cs new file mode 100644 index 00000000..0f5d1bc6 --- /dev/null +++ b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Startup.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.HttpsPolicy; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace O2NextGen.Mobile.BFF.Core +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseMvc(); + } + } +} + diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/appsettings.Development.json b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/appsettings.Development.json new file mode 100644 index 00000000..11a51145 --- /dev/null +++ b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/appsettings.Development.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} + diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/appsettings.json b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/appsettings.json new file mode 100644 index 00000000..013120d6 --- /dev/null +++ b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} + From 8d9fac5b63e71da2ec779b9fc8b0d368d7e1dcc5 Mon Sep 17 00:00:00 2001 From: Denis Prokhorchik Date: Sun, 9 Jan 2022 13:57:15 +0300 Subject: [PATCH 3/5] feat(issue-127): code cleanup --- .../O2NextGen.Mobile.BFF.Core.csproj | 4 ++++ .../O2NextGen.Mobile.BFF.Core/Startup.cs | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj index e7a1cb80..58a18861 100644 --- a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj +++ b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj @@ -6,6 +6,7 @@ + @@ -13,4 +14,7 @@ + + + diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Startup.cs b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Startup.cs index 0f5d1bc6..f532564f 100644 --- a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Startup.cs +++ b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Startup.cs @@ -22,13 +22,11 @@ public Startup(IConfiguration configuration) public IConfiguration Configuration { get; } - // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); } - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) From facbddfbf82b68863589479b1fd4fa3eae966261 Mon Sep 17 00:00:00 2001 From: Denis Prokhorchik Date: Sun, 9 Jan 2022 13:59:21 +0300 Subject: [PATCH 4/5] feat(issue-127): delete valuescontroller.cs --- .../Controllers/ValuesController.cs | 46 ------------------- .../O2NextGen.Mobile.BFF.Core.csproj | 2 + 2 files changed, 2 insertions(+), 46 deletions(-) delete mode 100644 src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Controllers/ValuesController.cs diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Controllers/ValuesController.cs b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Controllers/ValuesController.cs deleted file mode 100644 index 09f5cbed..00000000 --- a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Controllers/ValuesController.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace O2NextGen.Mobile.BFF.Core.Controllers -{ - [Route("api/[controller]")] - [ApiController] - public class ValuesController : ControllerBase - { - // GET api/values - [HttpGet] - public ActionResult> Get() - { - return new string[] { "value1", "value2" }; - } - - // GET api/values/5 - [HttpGet("{id}")] - public ActionResult Get(int id) - { - return "value"; - } - - // POST api/values - [HttpPost] - public void Post([FromBody] string value) - { - } - - // PUT api/values/5 - [HttpPut("{id}")] - public void Put(int id, [FromBody] string value) - { - } - - // DELETE api/values/5 - [HttpDelete("{id}")] - public void Delete(int id) - { - } - } -} - diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj index 58a18861..e3d61caa 100644 --- a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj +++ b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj @@ -7,6 +7,7 @@ + @@ -16,5 +17,6 @@ + From ce8c4aad631d6fb34aeade491864ad50e5c3be3b Mon Sep 17 00:00:00 2001 From: Denis Prokhorchik Date: Sun, 9 Jan 2022 14:08:19 +0300 Subject: [PATCH 5/5] feat(issue-127): add basic implantation of mobile gateway --- .../Features/C-Gen/CertificatesController.cs | 20 +++++++++++++++++++ .../Features/C-Gen/VersionController.cs | 20 +++++++++++++++++++ .../Features/E-Sender/VersionController.cs | 20 +++++++++++++++++++ .../O2NextGen.Mobile.BFF.Core.csproj | 6 ++++-- 4 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Features/C-Gen/CertificatesController.cs create mode 100644 src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Features/C-Gen/VersionController.cs create mode 100644 src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Features/E-Sender/VersionController.cs diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Features/C-Gen/CertificatesController.cs b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Features/C-Gen/CertificatesController.cs new file mode 100644 index 00000000..8b9b4550 --- /dev/null +++ b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Features/C-Gen/CertificatesController.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace O2NextGen.Mobile.BFF.Core.Features.CGen +{ + [Route("api/features/c-gen/[controller]")] + public class CertificatesController : Controller + { + // GET: api/features/c-gen/certificates + [HttpGet] + public IActionResult Get() + { + return Ok(); + } + } +} + diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Features/C-Gen/VersionController.cs b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Features/C-Gen/VersionController.cs new file mode 100644 index 00000000..7305f73b --- /dev/null +++ b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Features/C-Gen/VersionController.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace O2NextGen.Mobile.BFF.Core.Features.CGen +{ + [Route("api/features/c-gen/[controller]")] + public class VersionController : Controller + { + // GET: api/features/c-gen/version + [HttpGet] + public IActionResult Get() + { + return Ok(); + } + } +} + diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Features/E-Sender/VersionController.cs b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Features/E-Sender/VersionController.cs new file mode 100644 index 00000000..c0cec782 --- /dev/null +++ b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/Features/E-Sender/VersionController.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace O2NextGen.Mobile.BFF.Core.Features.ESender +{ + [Route("api/features/e-sender/[controller]")] + public class VersionController : Controller + { + // GET: api/features/e-sender/version + [HttpGet] + public IActionResult Get() + { + return Ok(); + } + } +} + diff --git a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj index e3d61caa..747837c1 100644 --- a/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj +++ b/src/ApiGateways/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core/O2NextGen.Mobile.BFF.Core.csproj @@ -7,7 +7,8 @@ - + + @@ -17,6 +18,7 @@ - + +