| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using Microsoft.AspNetCore.Mvc;
- using System.ComponentModel.DataAnnotations;
- namespace economy.Models.Price.Domestic.Flower
- {
- // 부류코드
- public enum SearchType : sbyte
- {
- CutFlower = 1,
- FoliagePlants = 2,
- Orchilds = 3,
- SpringOrchilds = 4
- }
- /*
- * 화훼 경락 일자별 경매정보
- * 예시 ) https://flower.at.or.kr/api/returnData.api?kind=f001&serviceKey=sample&baseDate=2018-08-16&flowerGubn=1&dataType=json&countPerPage=999
- */
- // 검색요청 변수
- public class Request
- {
- [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 = "date", SupportsGet = true)]
- [Required(ErrorMessage = "조회 날짜를 입력해주세요.")]
- [DataType(DataType.Date)]
- [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
- public DateTime BaseDate { get; set; } = DateTime.Now;
- [BindProperty(Name = "type", SupportsGet = true)]
- [Required(ErrorMessage = "부류코드를 입력해주세요.")]
- [EnumDataType(typeof(SearchType), ErrorMessage = "부류코드가 잘못되었습니다.")]
- public SearchType Type { get; set; } = SearchType.CutFlower;
- [BindProperty(Name = "pName", SupportsGet = true)]
- [MaxLength(100, ErrorMessage = "품목명은 100자까지 입력가능합니다.")]
- public string? PumName { get; set; }
- [BindProperty(Name = "gName", SupportsGet = true)]
- [MaxLength(100, ErrorMessage = "품종명은 100자까지 입력가능합니다.")]
- public string? GoodName { get; set; }
- }
- }
|