FIFA.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Microsoft.AspNetCore.Mvc;
  2. using System.ComponentModel.DataAnnotations;
  3. namespace economy.Models.FIFA
  4. {
  5. /*
  6. * FIFA 순위
  7. * 예시 ) https://api.fifa.com/api/v3/rankings?gender=1&count=5&language=ko
  8. */
  9. // 검색요청 변수
  10. public class Request
  11. {
  12. public enum Types
  13. {
  14. ALL,
  15. AFC,
  16. CAF,
  17. CONCACAF,
  18. CONMEBOL,
  19. OFC,
  20. UEFA
  21. }
  22. [BindProperty(Name = "page", SupportsGet = true)]
  23. [Range(1, int.MaxValue, ErrorMessage = "페이지 허용량을 초과하였습니다.")]
  24. public int PageNo { get; set; } = 1;
  25. [BindProperty(Name = "perPage", SupportsGet = true)]
  26. [Range(1, int.MaxValue, ErrorMessage = "출력 허용량을 초과하였습니다.")]
  27. public int NumOfRows { get; set; } = 10;
  28. [BindProperty(Name = "gender", SupportsGet = true)]
  29. [Range(1, 2, ErrorMessage = "순위 구분이 잘못되었습니다.")]
  30. public int Gender { get; set; } = 1;
  31. [FromQuery(Name = "type")]
  32. public Types? Type { get; set; } = null;
  33. }
  34. }