using Microsoft.AspNetCore.Mvc; using System.ComponentModel.DataAnnotations; namespace economy.Models.Price.Global.Commodity { /* * 국제 원자재 시세 (구리, 알루미늄, 밀, 섬유(면화), 설탕, 커피, 원자재 종합지수) * 예시 ) https://www.alphavantage.co/query?function=COPPER&interval=monthly&apikey=EFOBUHL5SFLBF2LN */ // 검색요청 변수 public class Request { [BindProperty(Name = "commodity", SupportsGet = true)] [StringLength(30, ErrorMessage = "상품 형식이 잘못되었습니다.")] public string? Commodity { get; set; } [BindProperty(Name = "page", SupportsGet = true)] [Range(1, int.MaxValue, ErrorMessage = "페이지 허용량을 초과하였습니다.")] public int PageNo { get; set; } = 1; [BindProperty(Name = "perPage", SupportsGet = true)] [Range(1, int.MaxValue, ErrorMessage = "출력 허용량을 초과하였습니다.")] public int NumOfRows { get; set; } = 10; [BindProperty(Name = "interval", SupportsGet = true)] [Required(ErrorMessage = "검색 구간을 입력해주세요.")] [StringLength(120, ErrorMessage = "검색 구간을 초과하였습니다.")] public string Interval { get; set; } = "monthly"; // quarterly, annual } }