删除测试代码

This commit is contained in:
zpc 2024-06-25 14:09:26 +08:00
parent 8936b9ff9c
commit cb4f3f556a
3 changed files with 4 additions and 47 deletions

View File

@ -1,33 +0,0 @@
using Microsoft.AspNetCore.Mvc;
namespace CodeRelease.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[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();
}
}
}

View File

@ -19,5 +19,8 @@ if (app.Environment.IsDevelopment())
app.UseAuthorization();
app.MapControllers();
app.MapGet("/", () =>
{
return "请求成功";
}).WithName("默认请求");
app.Run();

View File

@ -1,13 +0,0 @@
namespace CodeRelease
{
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; }
}
}