| 1234567891011121314151617181920212223242526272829 |
- using Microsoft.AspNetCore.Mvc;
- using System.ComponentModel.DataAnnotations;
- namespace economy.Models.Financial.Exchange
- {
- /*
- * 한국수출입은행이 제공하는 환율정보
- * 예시 ) https://www.koreaexim.go.kr/site/program/financial/exchangeJSON?authkey=OiZlh6SjbXGBlfbagekBpi6kAE4UyonP&searchdate=20241025&data=AP01
- */
- // 검색요청 변수
- public class Request
- {
- private DateOnly _date = DateOnly.FromDateTime(DateTime.Now);
- [BindProperty(Name = "date", SupportsGet = true)]
- [Required(ErrorMessage = "검색 날짜를 입력해주세요.")]
- [DataType(DataType.Date)]
- [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
- public DateOnly Date
- {
- get => _date;
- set => _date = value;
- }
- // 날짜 형식을 적용하여 문자열로 반환하는 추가 속성
- public string DateFormatted => _date.ToString("yyyy-MM-dd");
- }
- }
|