Skip to main content

neis_client/types/
academy_info.rs

1#![allow(non_snake_case)]
2use super::{ToQueryString, YesOrNo};
3use form_urlencoded::Serializer;
4use serde::{Deserialize, Serialize};
5
6#[derive(Debug, Clone, Serialize)]
7pub struct AcademyInfoParams {
8    /// 시도교육청코드
9    pub ATPT_OFCDC_SC_CODE: String,
10    /// 행정구역명
11    pub ADMST_ZONE_NM: Option<String>,
12    /// 학원지정번호
13    pub ACA_ASNUM: Option<String>,
14    /// 학원명
15    pub ACA_NM: Option<String>,
16    /// 분야명
17    pub REALM_SC_NM: Option<String>,
18    /// 교습계열명
19    pub LE_ORD_NM: Option<String>,
20    /// 교습과정명
21    pub LE_CRSE_NM: Option<String>,
22}
23
24impl AcademyInfoParams {
25    pub fn new(atpt_ofcdc_sc_code: &str) -> Self {
26        Self {
27            ATPT_OFCDC_SC_CODE: atpt_ofcdc_sc_code.to_owned(),
28            ADMST_ZONE_NM: None,
29            ACA_ASNUM: None,
30            ACA_NM: None,
31            REALM_SC_NM: None,
32            LE_ORD_NM: None,
33            LE_CRSE_NM: None,
34        }
35    }
36}
37
38impl ToQueryString for AcademyInfoParams {
39    fn to_query_string(&self) -> String {
40        let mut serializer = Serializer::new(String::new());
41
42        serializer.append_pair("ATPT_OFCDC_SC_CODE", &self.ATPT_OFCDC_SC_CODE);
43        if let Some(s) = &self.ADMST_ZONE_NM {
44            serializer.append_pair("ADMST_ZONE_NM", s);
45        }
46        if let Some(s) = &self.ACA_ASNUM {
47            serializer.append_pair("ACA_ASNUM", s);
48        }
49        if let Some(s) = &self.ACA_NM {
50            serializer.append_pair("ACA_NM", s);
51        }
52        if let Some(s) = &self.REALM_SC_NM {
53            serializer.append_pair("REALM_SC_NM", s);
54        }
55        if let Some(s) = &self.LE_ORD_NM {
56            serializer.append_pair("LE_ORD_NM", s);
57        }
58        if let Some(s) = &self.LE_CRSE_NM {
59            serializer.append_pair("LE_CRSE_NM", s);
60        }
61
62        serializer.finish()
63    }
64}
65
66#[derive(Debug, Clone, Deserialize, Hash)]
67pub struct AcademyInfoItem {
68    /// 시도교육청코드
69    /// B10 | C10 | D10 | E10 | F10 | G10 | H10 | I10 | J10 | K10 | M10 | N10 | P10 | Q10 | R10 | S10 | T10 | V10
70    pub ATPT_OFCDC_SC_CODE: String,
71
72    /// 시도교육청명
73    /// Example: 서울특별시교육청
74    pub ATPT_OFCDC_SC_NM: String,
75
76    /// 행정구역명
77    /// Example: 강남구
78    pub ADMST_ZONE_NM: Option<String>,
79
80    /// 학원교습소명
81    /// Example: 교습소
82    pub ACA_INSTI_SC_NM: String,
83
84    /// 학원지정번호
85    /// Example: 3000024877
86    pub ACA_ASNUM: String,
87
88    /// 학원명
89    /// Example: 9087스튜디오미술교습소
90    pub ACA_NM: String,
91
92    /// 개설일자
93    /// Example: 20151208
94    pub ESTBL_YMD: String,
95
96    /// 등록일자
97    /// Example: 20151208
98    pub REG_YMD: String,
99
100    /// 등록상태명
101    /// Example: 개원
102    pub REG_STTUS_NM: String,
103
104    /// 휴원시작일자
105    /// Example:
106    pub CAA_BEGIN_YMD: String,
107
108    /// 휴원종료일자
109    /// Example: 99991231
110    pub CAA_END_YMD: String,
111
112    /// 정원합계
113    /// Example: 4
114    pub TOFOR_SMTOT: i64,
115
116    /// 일시수용능력인원합계
117    /// Example: 9
118    pub DTM_RCPTN_ABLTY_NMPR_SMTOT: i64,
119
120    /// 분야명
121    /// Example: 예능(대)
122    pub REALM_SC_NM: Option<String>,
123
124    /// 교습계열명
125    /// Example: 예능(중)
126    pub LE_ORD_NM: Option<String>,
127
128    /// 교습과정목록명
129    /// Example: 드로잉
130    pub LE_CRSE_LIST_NM: Option<String>,
131
132    /// 교습과정명
133    /// Example: 미술
134    pub LE_CRSE_NM: Option<String>,
135
136    /// 인당수강료
137    /// Example:
138    pub PSNBY_THCC_CNTNT: String,
139
140    /// 수강료공개여부
141    pub THCC_OTHBC_YN: YesOrNo,
142
143    /// 기숙사학원여부
144    /// Example: N
145    pub BRHS_ACA_YN: String,
146
147    /// 도로명주소
148    /// Example: 서울특별시 서초구 바우뫼로20길 25
149    pub FA_RDNMA: String,
150
151    /// 도로명상세주소
152    /// Example: , 201호 (양재동, 서두빌딩)
153    pub FA_RDNDA: String,
154
155    /// 도로명우편번호
156    /// Example: 06755
157    pub FA_RDNZC: String,
158
159    /// 전화번호
160    pub FA_TELNO: Option<String>,
161
162    /// 수정일자
163    /// Example: 20231018
164    pub LOAD_DTM: String,
165}