[CHANGE] Reworking auth schemes & services, handlers, etc.

This commit is contained in:
max
2025-04-27 17:23:14 +02:00
parent 8e72d123fd
commit 46cf20893b
15 changed files with 249 additions and 64 deletions

View File

@@ -0,0 +1,30 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace TestWebApi.Controllers;
[ApiController]
[Route("[controller]")]
[Authorize]
public class WeatherController : ControllerBase
{
private readonly string[] _summaries =
[
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
];
[HttpGet("GetWeatherForecast")]
public async Task<ActionResult<List<WeatherForecast>>> GetForecast()
{
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)]
))
.ToList();
await Task.Delay(TimeSpan.FromSeconds(1));
return forecast;
}
}