feat: Initial project structure setup with solution and projects
This commit is contained in:
		
							
								
								
									
										17
									
								
								src/Mercados.Api/Mercados.Api.csproj
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								src/Mercados.Api/Mercados.Api.csproj
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
<Project Sdk="Microsoft.NET.Sdk.Web">
 | 
			
		||||
 | 
			
		||||
  <PropertyGroup>
 | 
			
		||||
    <TargetFramework>net9.0</TargetFramework>
 | 
			
		||||
    <Nullable>enable</Nullable>
 | 
			
		||||
    <ImplicitUsings>enable</ImplicitUsings>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.5" />
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <ProjectReference Include="..\Mercados.Infrastructure\Mercados.Infrastructure.csproj" />
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
 | 
			
		||||
</Project>
 | 
			
		||||
							
								
								
									
										6
									
								
								src/Mercados.Api/Mercados.Api.http
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								src/Mercados.Api/Mercados.Api.http
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
@Mercados.Api_HostAddress = http://localhost:5045
 | 
			
		||||
 | 
			
		||||
GET {{Mercados.Api_HostAddress}}/weatherforecast/
 | 
			
		||||
Accept: application/json
 | 
			
		||||
 | 
			
		||||
###
 | 
			
		||||
							
								
								
									
										41
									
								
								src/Mercados.Api/Program.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								src/Mercados.Api/Program.cs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,41 @@
 | 
			
		||||
var builder = WebApplication.CreateBuilder(args);
 | 
			
		||||
 | 
			
		||||
// Add services to the container.
 | 
			
		||||
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
 | 
			
		||||
builder.Services.AddOpenApi();
 | 
			
		||||
 | 
			
		||||
var app = builder.Build();
 | 
			
		||||
 | 
			
		||||
// Configure the HTTP request pipeline.
 | 
			
		||||
if (app.Environment.IsDevelopment())
 | 
			
		||||
{
 | 
			
		||||
    app.MapOpenApi();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
app.UseHttpsRedirection();
 | 
			
		||||
 | 
			
		||||
var summaries = new[]
 | 
			
		||||
{
 | 
			
		||||
    "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
app.MapGet("/weatherforecast", () =>
 | 
			
		||||
{
 | 
			
		||||
    var forecast =  Enumerable.Range(1, 5).Select(index =>
 | 
			
		||||
        new WeatherForecast
 | 
			
		||||
        (
 | 
			
		||||
            DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
 | 
			
		||||
            Random.Shared.Next(-20, 55),
 | 
			
		||||
            summaries[Random.Shared.Next(summaries.Length)]
 | 
			
		||||
        ))
 | 
			
		||||
        .ToArray();
 | 
			
		||||
    return forecast;
 | 
			
		||||
})
 | 
			
		||||
.WithName("GetWeatherForecast");
 | 
			
		||||
 | 
			
		||||
app.Run();
 | 
			
		||||
 | 
			
		||||
record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
 | 
			
		||||
{
 | 
			
		||||
    public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										23
									
								
								src/Mercados.Api/Properties/launchSettings.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								src/Mercados.Api/Properties/launchSettings.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
{
 | 
			
		||||
  "$schema": "https://json.schemastore.org/launchsettings.json",
 | 
			
		||||
  "profiles": {
 | 
			
		||||
    "http": {
 | 
			
		||||
      "commandName": "Project",
 | 
			
		||||
      "dotnetRunMessages": true,
 | 
			
		||||
      "launchBrowser": false,
 | 
			
		||||
      "applicationUrl": "http://localhost:5045",
 | 
			
		||||
      "environmentVariables": {
 | 
			
		||||
        "ASPNETCORE_ENVIRONMENT": "Development"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "https": {
 | 
			
		||||
      "commandName": "Project",
 | 
			
		||||
      "dotnetRunMessages": true,
 | 
			
		||||
      "launchBrowser": false,
 | 
			
		||||
      "applicationUrl": "https://localhost:7256;http://localhost:5045",
 | 
			
		||||
      "environmentVariables": {
 | 
			
		||||
        "ASPNETCORE_ENVIRONMENT": "Development"
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										8
									
								
								src/Mercados.Api/appsettings.Development.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/Mercados.Api/appsettings.Development.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
{
 | 
			
		||||
  "Logging": {
 | 
			
		||||
    "LogLevel": {
 | 
			
		||||
      "Default": "Information",
 | 
			
		||||
      "Microsoft.AspNetCore": "Warning"
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										9
									
								
								src/Mercados.Api/appsettings.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								src/Mercados.Api/appsettings.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
{
 | 
			
		||||
  "Logging": {
 | 
			
		||||
    "LogLevel": {
 | 
			
		||||
      "Default": "Information",
 | 
			
		||||
      "Microsoft.AspNetCore": "Warning"
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "AllowedHosts": "*"
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user