终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 rivejä
1023 B

  1. using Microsoft.AspNetCore.Mvc;
  2. namespace BPASmartClient.AgvApi.Controllers
  3. {
  4. [ApiController]
  5. [Route("[controller]")]
  6. public class WeatherForecastController : ControllerBase
  7. {
  8. private static readonly string[] Summaries = new[]
  9. {
  10. "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
  11. };
  12. private readonly ILogger<WeatherForecastController> _logger;
  13. public WeatherForecastController(ILogger<WeatherForecastController> logger)
  14. {
  15. _logger = logger;
  16. }
  17. [HttpGet(Name = "GetWeatherForecast")]
  18. public IEnumerable<WeatherForecast> Get()
  19. {
  20. return Enumerable.Range(1, 5).Select(index => new WeatherForecast
  21. {
  22. Date = DateTime.Now.AddDays(index),
  23. TemperatureC = Random.Shared.Next(-20, 55),
  24. Summary = Summaries[Random.Shared.Next(Summaries.Length)]
  25. })
  26. .ToArray();
  27. }
  28. }
  29. }