修改代码
增加云商品数据
This commit is contained in:
1 parent
2f406c840f
commit
db4f030c17
58 files changed
+1550
-120
No files matched your search
@@ -5,29 +5,29 @@ using Store.Api;
|
||||
|
||||
namespace Store.Api.Controllers.v2
|
||||
{
|
||||
[ApiController]
|
||||
[ApiVersion("2.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"
|
||||
];
|
||||
//[ApiController]
|
||||
//[ApiVersion("2.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 = "GetWeatherForecastV2")]
|
||||
public ApiResult<IEnumerable<WeatherForecastV2>> Get()
|
||||
{
|
||||
IEnumerable<WeatherForecastV2> data = Enumerable.Range(1, 10).Select(index => new WeatherForecastV2
|
||||
{
|
||||
Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
|
||||
TemperatureC = Random.Shared.Next(-20, 55),
|
||||
FeelsLikeC = Random.Shared.Next(-20, 55),
|
||||
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
|
||||
})
|
||||
.ToArray();
|
||||
// [HttpGet(Name = "GetWeatherForecastV2")]
|
||||
// public ApiResult<IEnumerable<WeatherForecastV2>> Get()
|
||||
// {
|
||||
// IEnumerable<WeatherForecastV2> data = Enumerable.Range(1, 10).Select(index => new WeatherForecastV2
|
||||
// {
|
||||
// Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
|
||||
// TemperatureC = Random.Shared.Next(-20, 55),
|
||||
// FeelsLikeC = Random.Shared.Next(-20, 55),
|
||||
// Summary = Summaries[Random.Shared.Next(Summaries.Length)]
|
||||
// })
|
||||
// .ToArray();
|
||||
|
||||
return ApiResult<IEnumerable<WeatherForecastV2>>.Success(data);
|
||||
}
|
||||
}
|
||||
// return ApiResult<IEnumerable<WeatherForecastV2>>.Success(data);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
Reference in new issue
Block a user