Replace weather example with shared YouTube models

Removed WeatherForecast API and model. Added TuneRipper.Shared project with shared configuration and YouTube processing models. Updated solution and project references to enable code sharing between API and client. Explicitly included Controllers folder in API project.
This commit is contained in:
Michal Vrba
2025-12-11 14:11:46 +01:00
parent b5376f342a
commit 5230bddc03
9 changed files with 71 additions and 39 deletions
@@ -1,26 +0,0 @@
using Microsoft.AspNetCore.Mvc;
namespace TuneRipper.Api.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries =
[
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
];
[HttpGet(Name = "GetWeatherForecast")]
public IEnumerable<WeatherForecast> 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();
}
}
}
+8
View File
@@ -10,4 +10,12 @@
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TuneRipper.Shared\TuneRipper.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Controllers\" />
</ItemGroup>
</Project>
-13
View File
@@ -1,13 +0,0 @@
namespace TuneRipper.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; }
}
}