From 6a932ea9625b3b0150299907bcc067c09d1dde0e Mon Sep 17 00:00:00 2001 From: Riccardo Usardi Date: Fri, 4 Jul 2025 20:51:56 +0200 Subject: [PATCH] init Api project --- .vs/uWine/DesignTimeBuild/.dtbcache.v2 | Bin 101161 -> 101161 bytes .vs/uWine/v17/.suo | Bin 84480 -> 84480 bytes .vs/uWine/v17/DocumentLayout.backup.json | 55 +++++-------- .vs/uWine/v17/DocumentLayout.json | 74 +++++------------- .../Controllers/WeatherForecastController.cs | 33 ++++++++ uWine.Api/Program.cs | 25 ++++++ uWine.Api/Properties/launchSettings.json | 41 ++++++++++ uWine.Api/WeatherForecast.cs | 13 +++ uWine.Api/appsettings.Development.json | 8 ++ uWine.Api/appsettings.json | 9 +++ uWine.Api/uWine.Api.csproj | 13 +++ uWine.Api/uWine.Api.csproj.user | 6 ++ uWine.Api/uWine.Api.http | 6 ++ .../net8.0/uWine.Core.Domain.AssemblyInfo.cs | 2 +- ...uWine.Core.Domain.AssemblyInfoInputs.cache | 2 +- uWine.sln | 8 +- 16 files changed, 202 insertions(+), 93 deletions(-) create mode 100644 uWine.Api/Controllers/WeatherForecastController.cs create mode 100644 uWine.Api/Program.cs create mode 100644 uWine.Api/Properties/launchSettings.json create mode 100644 uWine.Api/WeatherForecast.cs create mode 100644 uWine.Api/appsettings.Development.json create mode 100644 uWine.Api/appsettings.json create mode 100644 uWine.Api/uWine.Api.csproj create mode 100644 uWine.Api/uWine.Api.csproj.user create mode 100644 uWine.Api/uWine.Api.http diff --git a/.vs/uWine/DesignTimeBuild/.dtbcache.v2 b/.vs/uWine/DesignTimeBuild/.dtbcache.v2 index 98c008e639639c57cb469f858f8a12774bb5f7ed..0a944c2ac98ec5176c3af9d40b91d1b6f03fe846 100644 GIT binary patch delta 593 zcmZ|L%P#{#90&0ES*ajFB9*v^aFj4>+wO4Dn>b0FJVSLyQt_xRs*0`m`%Tv)h@+#3 z?2&)PP25~0PJBlY7n}LaZ+<(!d1P*~zMHI%&gbc#=(et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!QDIToG7_Q&rwg%~$!`-jHUeFU zBL-)Ahva1{1|P0qFdJ~Ul^9@Vb!sAlm@HXzuA9?HTugAXWJ?@)FPj2FqBr?^{=Re1 z*L!bXTer5YTkCgPqg5&uVOUsPTx3S2W)Oz=#1mnEOiw`f+xL*nGKD$VOq$_KdWYKdaxp7>&JkH0!C+>1bb@r zz&auf(8`!H4k`$>PTuHZW{v;JGMfdELS+=kj4(u!eyP=JWpU=luU6n6_$s zFk-X;I!u#Yb(WQ`P^_cHapN!&m#m@58CO9`AW}|;wvUZ54ex0L#YQAYC=y&Ok-&h{ z30v@fQUty0(1Vh!Ggq}wUoNcAuXz9Dtz$bIpD|IhnF5CLU27_6PN5jumQCkVj4+Z+ z2qpFfwg(vz+<@+qRt!bClw3YPlFvWIu!z~F>8`q7$?n$h`^T>m()h8JF&r(!W_wBG z(ydqYlrAm)&y%%xchfcbXN2yuwoZ_0yy(p={($Fp?^d2Abk~dp(BAHoS|X&Wbi5FJKN4oX16z?|Ez#Bo}CcF;a}h69?kO1 zuvx>)n(;z^Hcp-HN7oJKIwH0z13J0Z2vu0_->S5j@an`7^bMwAPu+PM9uom?c(%#@ zcsR>{o(m4eKrGPD2W}HsB|#kmH{InK1Uh)B;t_;n9aw)UU#)VlVl4}ei!CW@s;O?+ zTU}S%_^P+I;c(`GMkv6psYE<+MTlKn%)#L+Hp|-le>Z8Dn(*zPUl8~+ _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } + } +} diff --git a/uWine.Api/Program.cs b/uWine.Api/Program.cs new file mode 100644 index 0000000..48863a6 --- /dev/null +++ b/uWine.Api/Program.cs @@ -0,0 +1,25 @@ +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.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/uWine.Api/Properties/launchSettings.json b/uWine.Api/Properties/launchSettings.json new file mode 100644 index 0000000..67b6317 --- /dev/null +++ b/uWine.Api/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:24444", + "sslPort": 44300 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5144", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7287;http://localhost:5144", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/uWine.Api/WeatherForecast.cs b/uWine.Api/WeatherForecast.cs new file mode 100644 index 0000000..63a6b63 --- /dev/null +++ b/uWine.Api/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace uWine.Api +{ + public class WeatherForecast + { + public DateOnly Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} diff --git a/uWine.Api/appsettings.Development.json b/uWine.Api/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/uWine.Api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/uWine.Api/appsettings.json b/uWine.Api/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/uWine.Api/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/uWine.Api/uWine.Api.csproj b/uWine.Api/uWine.Api.csproj new file mode 100644 index 0000000..9daa180 --- /dev/null +++ b/uWine.Api/uWine.Api.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/uWine.Api/uWine.Api.csproj.user b/uWine.Api/uWine.Api.csproj.user new file mode 100644 index 0000000..9ff5820 --- /dev/null +++ b/uWine.Api/uWine.Api.csproj.user @@ -0,0 +1,6 @@ + + + + https + + \ No newline at end of file diff --git a/uWine.Api/uWine.Api.http b/uWine.Api/uWine.Api.http new file mode 100644 index 0000000..e7082ac --- /dev/null +++ b/uWine.Api/uWine.Api.http @@ -0,0 +1,6 @@ +@uWine.Api_HostAddress = http://localhost:5144 + +GET {{uWine.Api_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfo.cs b/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfo.cs index 3989788..1ba1a30 100644 --- a/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfo.cs +++ b/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("uWine.Core.Domain")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+b7983dae8eb41b8762561f39a8983964d6b51642")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0a6744e8b0a2fd3c4d6aafc2f8b6ded05e8494c8")] [assembly: System.Reflection.AssemblyProductAttribute("uWine.Core.Domain")] [assembly: System.Reflection.AssemblyTitleAttribute("uWine.Core.Domain")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfoInputs.cache b/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfoInputs.cache index 25d57c8..d892972 100644 --- a/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfoInputs.cache +++ b/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfoInputs.cache @@ -1 +1 @@ -2938b75c4e5ef3e81cc5a8d84e687c6e2754a5a72fb2fca8be69fe3f8ccc7d39 +e85dab582382660b25a0c508996ac5ca8c4a30986ac9bf825b8119bab71a55a4 diff --git a/uWine.sln b/uWine.sln index b540519..994cdd9 100644 --- a/uWine.sln +++ b/uWine.sln @@ -5,7 +5,9 @@ VisualStudioVersion = 17.11.35222.181 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "uWine.Core.Domain", "uWine.Core.Domain\uWine.Core.Domain.csproj", "{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "uWine.Core.Infrastructure", "uWine.Core.Infrastructure\uWine.Core.Infrastructure.csproj", "{50360CEE-B38B-4729-ACA3-ABC3ED3538E9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "uWine.Core.Infrastructure", "uWine.Core.Infrastructure\uWine.Core.Infrastructure.csproj", "{50360CEE-B38B-4729-ACA3-ABC3ED3538E9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "uWine.Api", "uWine.Api\uWine.Api.csproj", "{0D13D3DD-79D5-4098-926A-60CE25BF1833}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,6 +23,10 @@ Global {50360CEE-B38B-4729-ACA3-ABC3ED3538E9}.Debug|Any CPU.Build.0 = Debug|Any CPU {50360CEE-B38B-4729-ACA3-ABC3ED3538E9}.Release|Any CPU.ActiveCfg = Release|Any CPU {50360CEE-B38B-4729-ACA3-ABC3ED3538E9}.Release|Any CPU.Build.0 = Release|Any CPU + {0D13D3DD-79D5-4098-926A-60CE25BF1833}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0D13D3DD-79D5-4098-926A-60CE25BF1833}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0D13D3DD-79D5-4098-926A-60CE25BF1833}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0D13D3DD-79D5-4098-926A-60CE25BF1833}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE