终端一体化运控平台
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

33 rader
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. }