From 3c71b12f285132f6c57a740cfe2e9ba7517f1172 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Tue, 17 Jan 2023 23:14:05 +0200 Subject: [PATCH] Add project files. --- Correo.sln | 25 +++++++++++++++++++ Correo/Controllers/SystemController.cs | 22 +++++++++++++++++ Correo/Correo.csproj | 13 ++++++++++ Correo/Program.cs | 34 ++++++++++++++++++++++++++ Correo/Properties/launchSettings.json | 14 +++++++++++ Correo/appsettings.Development.json | 8 ++++++ Correo/appsettings.json | 9 +++++++ 7 files changed, 125 insertions(+) create mode 100644 Correo.sln create mode 100644 Correo/Controllers/SystemController.cs create mode 100644 Correo/Correo.csproj create mode 100644 Correo/Program.cs create mode 100644 Correo/Properties/launchSettings.json create mode 100644 Correo/appsettings.Development.json create mode 100644 Correo/appsettings.json diff --git a/Correo.sln b/Correo.sln new file mode 100644 index 0000000..4ac6e1a --- /dev/null +++ b/Correo.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33205.214 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Correo", "Correo\Correo.csproj", "{B712E585-E63F-4A6D-8E17-FEFACE04BBE2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B712E585-E63F-4A6D-8E17-FEFACE04BBE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B712E585-E63F-4A6D-8E17-FEFACE04BBE2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B712E585-E63F-4A6D-8E17-FEFACE04BBE2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B712E585-E63F-4A6D-8E17-FEFACE04BBE2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {86FCF989-26FC-41E9-8A23-9485606D619D} + EndGlobalSection +EndGlobal diff --git a/Correo/Controllers/SystemController.cs b/Correo/Controllers/SystemController.cs new file mode 100644 index 0000000..7cedb54 --- /dev/null +++ b/Correo/Controllers/SystemController.cs @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.Mvc; + +namespace Correo.Controllers +{ + [ApiController] + [Route("[controller]")] + public class SystemController : ControllerBase + { + private readonly ILogger _logger; + + public SystemController(ILogger logger) + { + _logger = logger; + } + + [HttpGet("ping")] + public string Get() + { + return $"Ping success. System datetime: {DateTime.Now}"; + } + } +} \ No newline at end of file diff --git a/Correo/Correo.csproj b/Correo/Correo.csproj new file mode 100644 index 0000000..60bf9ea --- /dev/null +++ b/Correo/Correo.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/Correo/Program.cs b/Correo/Program.cs new file mode 100644 index 0000000..c77867f --- /dev/null +++ b/Correo/Program.cs @@ -0,0 +1,34 @@ +namespace Correo +{ + public class Program + { + public static void Main(string[] args) + { + var builder = WebApplication.CreateBuilder(args); + + // Add services to the container. + + builder.Services.AddControllers(); + + // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle + builder.Services.AddEndpointsApiExplorer(); + builder.Services.AddSwaggerGen(); + + var app = builder.Build(); + + // Configure the HTTP request pipeline. + if (app.Environment.IsDevelopment()) + { + app.UseSwagger(); + app.UseSwaggerUI(); + } + + app.UseAuthorization(); + + + app.MapControllers(); + + app.Run(); + } + } +} \ No newline at end of file diff --git a/Correo/Properties/launchSettings.json b/Correo/Properties/launchSettings.json new file mode 100644 index 0000000..57aabc2 --- /dev/null +++ b/Correo/Properties/launchSettings.json @@ -0,0 +1,14 @@ +{ + "profiles": { + "Correo": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5061", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/Correo/appsettings.Development.json b/Correo/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/Correo/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/Correo/appsettings.json b/Correo/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/Correo/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}