添加项目文件。

This commit is contained in:
chfei committed 2026-08-14 18:00:58 +08:00
1 parent 6a017c9547
commit 58abbb5b4f
86 files changed
+8729

No files matched your search

@@ -0,0 +1,33 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Mvc;
using StoreHub.Framework.Commons;
using System.ComponentModel;
namespace StoreHub.Controllers
{
[ApiController]
[Description("测试温度")]
[ApiVersion("1.0")]
[Route("api/v{version:apiVersion}/[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries =
[
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
];
[HttpGet(Name = "GetWeatherForecast")]
public ApiResult<IEnumerable<WeatherForecast>> Get()
{
IEnumerable<WeatherForecast> data = 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();
return ApiResult.Success(data);
}
}
}