NaturalGas.cs 1.1 KB

12345678910111213141516171819202122232425262728
  1. using Microsoft.AspNetCore.Mvc;
  2. using System.ComponentModel.DataAnnotations;
  3. namespace economy.Models.Price.Global.NaturalGas
  4. {
  5. /*
  6. * 천연가스
  7. * 예시 ) https://www.alphavantage.co/query?function=NATURAL_GAS&interval=monthly&apikey=EFOBUHL5SFLBF2LN
  8. */
  9. // 검색요청 변수
  10. public class Request
  11. {
  12. [BindProperty(Name = "page", SupportsGet = true)]
  13. [Range(1, int.MaxValue, ErrorMessage = "페이지 허용량을 초과하였습니다.")]
  14. public int PageNo { get; set; } = 1;
  15. [BindProperty(Name = "perPage", SupportsGet = true)]
  16. [Range(1, int.MaxValue, ErrorMessage = "출력 허용량을 초과하였습니다.")]
  17. public int NumOfRows { get; set; } = 10;
  18. [ViewData]
  19. [BindProperty(Name = "interval", SupportsGet = true)]
  20. [Required(ErrorMessage = "검색 구간을 입력해주세요.")]
  21. [StringLength(120, ErrorMessage = "검색 구간을 초과하였습니다.")]
  22. public required string Interval { get; set; } = "daily"; // weekly, monthly
  23. }
  24. }