diff --git "a/ADR/\354\204\234\353\270\214_\355\214\250\355\202\244\354\247\200_\354\247\200\354\233\220\353\260\251\354\213\235.md" "b/ADR/\354\204\234\353\270\214_\355\214\250\355\202\244\354\247\200_\354\247\200\354\233\220\353\260\251\354\213\235.md" new file mode 100644 index 0000000..d6d9950 --- /dev/null +++ "b/ADR/\354\204\234\353\270\214_\355\214\250\355\202\244\354\247\200_\354\247\200\354\233\220\353\260\251\354\213\235.md" @@ -0,0 +1,35 @@ +--- + +title: 서브 패키지 지원 방식 +date: 2023-05-30 + +--- + +# ConcurrencyNeiSwift, CombineNeiSwift같은 서브 패키지에서 NeiSwift 패키지에 정의된 API를 지원 하는 방식 + +## Context + +CombineNeisProtocol과 같은 protocol을 만들고 API가 AnyPublisher를 return하도록 하고, NeiSwift 패키지의 Neis 구조체가 CombineNeisProtocol을 채택하도록 작성 +vs +NeiSwift 패키지의 NeisProtocol을 확장하여 그 안에 AnyPublisher를 리턴하는 확장함수 작성 + +## Decision + +CombineNeisProtocol, AsyncNeisProtocol을 만들어 Neis 구조체가 채택하도록 작성 + +### Why + +NeisProtocol에 extension 으로 추가할 시 간편하게 확장할 수 있지만, +POP 관점에서 protocol과 protocol을 조합해서 만드는 것이 이상적이라 생각하여 전자의 방식을 택. + +## Consequences + +### Benefit + +- POP적인 코드 +- 필요에 따라 AsyncNeisProtocol, CombineNeisProtocol만 구현해 따로 주입이 가능 + +### Concern + +- 코드가 2배?! + diff --git a/Sources/AsyncNeiSwift/AcaInsTiInfo/AsyncAcaInsTiInfoFetchable+Neis.swift b/Sources/AsyncNeiSwift/AcaInsTiInfo/AsyncAcaInsTiInfoFetchable+Neis.swift deleted file mode 100644 index 8b23891..0000000 --- a/Sources/AsyncNeiSwift/AcaInsTiInfo/AsyncAcaInsTiInfoFetchable+Neis.swift +++ /dev/null @@ -1,33 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncAcaInsTiInfoFetchable where Self: NeisRequestable { - func fetchAcaInsTiList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - ADMST_ZONE_NM: String?, - ACA_ASNUM: String?, - ACA_NM: String?, - REALM_SC_NM: String?, - LE_ORD_NM: String?, - LE_CRSE_NM: String? - ) async throws -> [AcaInsTiInfoResponse] { - try await withCheckedThrowingContinuation { continuation in - self.fetchAcaInsTiList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - ADMST_ZONE_NM: ADMST_ZONE_NM, - ACA_ASNUM: ACA_ASNUM, - ACA_NM: ACA_NM, - REALM_SC_NM: REALM_SC_NM, - LE_ORD_NM: LE_ORD_NM, - LE_CRSE_NM: LE_CRSE_NM, - completion: continuation.resume(with:) - ) - } - } -} diff --git a/Sources/AsyncNeiSwift/AcaInsTiInfo/AsyncAcaInsTiInfoFetchable+default.swift b/Sources/AsyncNeiSwift/AcaInsTiInfo/AsyncAcaInsTiInfoFetchable+default.swift deleted file mode 100644 index 48a2e60..0000000 --- a/Sources/AsyncNeiSwift/AcaInsTiInfo/AsyncAcaInsTiInfoFetchable+default.swift +++ /dev/null @@ -1,65 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncAcaInsTiInfoFetchable { - /** - 개설되어있는 학원 및 교습소의 학원명, 휴원일자, 등록상태, 정원, 분야, 계열 및 과정등을 확인할 수 있으며 수강료 공개여부에 따라 수강료 내용을 확인할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - ADMST_ZONE_NM: (Optional) 행정구역명 - - ACA_ASNUM: (Optional) 학원지정번호 - - ACA_NM: (Optional) 학원명 - - REALM_SC_NM: (Optional) 분야명 - - LE_ORD_NM: (Optional) 교습계열명 - - LE_CRSE_NM: (Optional) 교습과정명 - - - Returns: `[AcaInsTiInfoResponse]` - */ - func fetchAcaInsTiListPublisher( - key: String, - ATPT_OFCDC_SC_CODE: String - ) async throws -> [AcaInsTiInfoResponse] { - try await self.fetchAcaInsTiList( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - ADMST_ZONE_NM: nil, - ACA_ASNUM: nil, - ACA_NM: nil, - REALM_SC_NM: nil, - LE_ORD_NM: nil, - LE_CRSE_NM: nil - ) - } - - func fetchAcaInsTiList( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - ADMST_ZONE_NM: String? = nil, - ACA_ASNUM: String? = nil, - ACA_NM: String? = nil, - REALM_SC_NM: String? = nil, - LE_ORD_NM: String? = nil, - LE_CRSE_NM: String? = nil - ) async throws -> [AcaInsTiInfoResponse] { - try await self.fetchAcaInsTiList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - ADMST_ZONE_NM: ADMST_ZONE_NM, - ACA_ASNUM: ACA_ASNUM, - ACA_NM: ACA_NM, - REALM_SC_NM: REALM_SC_NM, - LE_ORD_NM: LE_ORD_NM, - LE_CRSE_NM: LE_CRSE_NM - ) - } -} diff --git a/Sources/AsyncNeiSwift/AcaInsTiInfo/AsyncAcaInsTiInfoFetchable.swift b/Sources/AsyncNeiSwift/AcaInsTiInfo/AsyncAcaInsTiInfoFetchable.swift deleted file mode 100644 index 5c07210..0000000 --- a/Sources/AsyncNeiSwift/AcaInsTiInfo/AsyncAcaInsTiInfoFetchable.swift +++ /dev/null @@ -1,34 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol AsyncAcaInsTiInfoFetchable: AcaInsTiInfoFetchable { - /** - 개설되어있는 학원 및 교습소의 학원명, 휴원일자, 등록상태, 정원, 분야, 계열 및 과정등을 확인할 수 있으며 수강료 공개여부에 따라 수강료 내용을 확인할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - ADMST_ZONE_NM: (Optional) 행정구역명 - - ACA_ASNUM: (Optional) 학원지정번호 - - ACA_NM: (Optional) 학원명 - - REALM_SC_NM: (Optional) 분야명 - - LE_ORD_NM: (Optional) 교습계열명 - - LE_CRSE_NM: (Optional) 교습과정명 - - - Returns: `[AcaInsTiInfoResponse]` - */ - func fetchAcaInsTiList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, /// 시도 교육청 코드 - ADMST_ZONE_NM: String?, /// 행정구역명 - ACA_ASNUM: String?, /// 학원지정번호 - ACA_NM: String?, /// 학원명 - REALM_SC_NM: String?, /// 분야명 - LE_ORD_NM: String?, /// 교습계열명 - LE_CRSE_NM: String? /// 교습과정명 - ) async throws -> [AcaInsTiInfoResponse] -} diff --git a/Sources/AsyncNeiSwift/AsyncNeisProtocol.swift b/Sources/AsyncNeiSwift/AsyncNeisProtocol.swift new file mode 100644 index 0000000..c8f6a32 --- /dev/null +++ b/Sources/AsyncNeiSwift/AsyncNeisProtocol.swift @@ -0,0 +1,245 @@ +import NeiSwift + +@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) +public protocol AsyncNeisProtocol { + /** + 개설되어있는 학원 및 교습소의 학원명, 휴원일자, 등록상태, 정원, 분야, 계열 및 과정등을 확인할 수 있으며 수강료 공개여부에 따라 수강료 내용을 확인할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - ADMST_ZONE_NM: (Optional) 행정구역명 + - ACA_ASNUM: (Optional) 학원지정번호 + - ACA_NM: (Optional) 학원명 + - REALM_SC_NM: (Optional) 분야명 + - LE_ORD_NM: (Optional) 교습계열명 + - LE_CRSE_NM: (Optional) 교습과정명 + + - Returns: `[AcaInsTiInfoResponse]` + */ + func fetchAcaInsTiList( + request: AcaInsTiInfoRequest + ) async throws -> [AcaInsTiInfoResponse] + + /** + 학교명 등의 검색 조건을 선택하여 반정보를 검색할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - GRADE: (Optional) 학년 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 + - ORD_SC_NM: (Optional) 계열명 + - DDDEP_NM: (Optional) 학과명 + + - Returns: `[ClassInfoResponse]` + */ + func fetchClassInfo( + request: ClassInfoRequest + ) async throws -> [ClassInfoResponse] + + /** + 초등학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다 + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - GRADE: (Optional) 학년 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `[ElsTimeTableResponse]` + */ + func fetchElsTimeTable( + request: ElsTimeTableRequest + ) async throws -> [ElsTimeTableResponse] + + /** + 고등학교 학년도, 학교, 계열, 학과, 학기, 학년, 강의실, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - GRADE: (Optional) 학년 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `[HisTimeTableResponse]` + */ + func fetchHisTimeTable( + request: HisTimeTableRequest + ) async throws -> [HisTimeTableResponse] + + /** + 학교에서 제공하는 현재년도 급식의 요리명, 원산지정보, 칼로리정보, 영양정보 등의 일자별 현황입니다. + + * 요리명에 표시된 번호는 알레르기를 유발할수 있는 식재료입니다 (1.난류, 2.우유, 3.메밀, 4.땅콩, 5.대두, 6.밀, 7.고등어, 8.게, 9.새우, 10.돼지고기, 11.복숭아, 12.토마토, 13.아황산염, 14.호두, 15.닭고기, 16.쇠고기, 17.오징어, 18.조개류(굴,전복,홍합 등)) + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - MMEAL_SC_CODE: (Optional) 식사코드 + - MLSV_YMD: (Optional) 급식일자 + - MLSV_FROM_YMD: (Optional) 급식일자(시작일자) + - MLSV_TO_YMD: (Optional) 급식일자(종료일자) + + - Returns: `[MealInfoResponse]` + */ + func fetchMealInfo( + request: MealInfoRequest + ) async throws -> [MealInfoResponse] + + /** + 중학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - GRADE: (Optional) 학년 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `[MisTimeTableResponse]` + */ + func fetchMisTimeTable( + request: MisTimeTableRequest + ) async throws -> [MisTimeTableResponse] + + /** + 학교별 학과 정보를 조회할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: (Optional) 표준학교코드 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - ORD_SC_NM: (Optional) 계열명 + + - Returns: `[SchoolDepartmentResponse]` + */ + func fetchSchoolDepartmentList( + request: SchoolDepartmentRequest + ) async throws -> [SchoolDepartmentResponse] + + /** + 학교 기본정보에 대한 학교명, 소재지, 주소, 전화번호, 홈페이지주소, 남녀공학여부, 주야구분, 개교기념일 등을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: (Optional) 시도교육청코드 + - SD_SCHUL_CODE: (Optional) 표준학교코드 + - SCHUL_NM: (Optional) 학교명 + - SCHUL_KND_SC_NM: (Optional) 학교 종류명 + - LCTN_SC_NM: (Optional) 소재지명 + - FOND_SC_NM: (Optional) 설립명 + + - Returns: `[SchoolInfoResponse]` + */ + func fetchSchoolList( + request: SchoolInfoRequest + ) async throws -> [SchoolInfoResponse] + + /** + 학교명 등의 검색 조건을 선택하여 학교계열정보를 검색할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: (Optional) 표준학교코드 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + + - Returns: `[SchulAflcoinfoResponse]` + */ + func fetchSchulAflcoinfoList( + request: SchulAflcoinfoRequest + ) async throws -> [SchulAflcoinfoResponse] + + /** + 특수학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 + - GRADE: (Optional) 학년 + - CLRM_NM: (Optional) 강의실명 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `[SpsTimeTableResponse]` + */ + func fetchSpsTimeTable( + request: SpsTimeTableRequest + ) async throws -> [SpsTimeTableResponse] + + /** + 학교명 등의 검색 조건을 선택하여 시간표강의실 정보를 검색 할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 번호 + - pSize: 한 페이지 결과 수 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 학교코드 + - AY: (Optional) 학년도 + - GRADE: (Optional) 학년 + - SEM: (Optional) 학기 + - SCHUL_CRSE_SC_NM: (Optional) 학교종류명 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - ORD_SC_NM: (Optional) 계열명 + - DDDEP_NM: (Optional) 학과명 + + - Returns: `[TimeTableClassRoomInfoResponse]` + */ + func fetchTimeTableClassRoom( + request: TimeTableClassRoomInfoRequest + ) async throws -> [TimeTableClassRoomInfoResponse] +} diff --git a/Sources/AsyncNeiSwift/ClassInfo/AsyncClassInfoFetchable+Neis.swift b/Sources/AsyncNeiSwift/ClassInfo/AsyncClassInfoFetchable+Neis.swift deleted file mode 100644 index 25dd0fb..0000000 --- a/Sources/AsyncNeiSwift/ClassInfo/AsyncClassInfoFetchable+Neis.swift +++ /dev/null @@ -1,35 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncClassInfoFetchable where Self: NeisRequestable { - func fetchClassInfo( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - GRADE: String?, - DGHT_CRSE_SC_NM: String?, - SCHUL_CRSE_SC_NM: String?, - ORD_SC_NM: String?, - DDDEP_NM: String? - ) async throws -> [ClassInfoResponse] { - try await withCheckedThrowingContinuation { continuation in - self.fetchClassInfo( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - GRADE: GRADE, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - SCHUL_CRSE_SC_NM: SCHUL_CRSE_SC_NM, - ORD_SC_NM: ORD_SC_NM, - DDDEP_NM: DDDEP_NM, - completion: continuation.resume(with:) - ) - } - } -} diff --git a/Sources/AsyncNeiSwift/ClassInfo/AsyncClassInfoFetchable+default.swift b/Sources/AsyncNeiSwift/ClassInfo/AsyncClassInfoFetchable+default.swift deleted file mode 100644 index 7a52fd6..0000000 --- a/Sources/AsyncNeiSwift/ClassInfo/AsyncClassInfoFetchable+default.swift +++ /dev/null @@ -1,71 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncClassInfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 반정보를 검색할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - GRADE: (Optional) 학년 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 - - ORD_SC_NM: (Optional) 계열명 - - DDDEP_NM: (Optional) 학과명 - - - Returns: `[ClassInfoResponse]` - */ - func fetchClassInfo( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String - ) async throws -> [ClassInfoResponse] { - try await self.fetchClassInfo( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - GRADE: nil, - DGHT_CRSE_SC_NM: nil, - SCHUL_CRSE_SC_NM: nil, - ORD_SC_NM: nil, - DDDEP_NM: nil - ) - } - - - func fetchClassInfo( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - GRADE: String? = nil, - DGHT_CRSE_SC_NM: String? = nil, - SCHUL_CRSE_SC_NM: String? = nil, - ORD_SC_NM: String? = nil, - DDDEP_NM: String? = nil - ) async throws -> [ClassInfoResponse] { - try await self.fetchClassInfo( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - GRADE: GRADE, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - SCHUL_CRSE_SC_NM: SCHUL_CRSE_SC_NM, - ORD_SC_NM: ORD_SC_NM, - DDDEP_NM: DDDEP_NM - ) - } -} diff --git a/Sources/AsyncNeiSwift/ClassInfo/AsyncClassInfoFetchable.swift b/Sources/AsyncNeiSwift/ClassInfo/AsyncClassInfoFetchable.swift deleted file mode 100644 index 945759f..0000000 --- a/Sources/AsyncNeiSwift/ClassInfo/AsyncClassInfoFetchable.swift +++ /dev/null @@ -1,36 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol AsyncClassInfoFetchable: ClassInfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 반정보를 검색할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - GRADE: (Optional) 학년 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 - - ORD_SC_NM: (Optional) 계열명 - - DDDEP_NM: (Optional) 학과명 - - - Returns: `[ClassInfoResponse]` - */ - func fetchClassInfo( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - GRADE: String?, - DGHT_CRSE_SC_NM: String?, - SCHUL_CRSE_SC_NM: String?, - ORD_SC_NM: String?, - DDDEP_NM: String? - ) async throws -> [ClassInfoResponse] -} diff --git a/Sources/AsyncNeiSwift/ElsTimeTable/AsyncElsTimeTableFetchable+Neis.swift b/Sources/AsyncNeiSwift/ElsTimeTable/AsyncElsTimeTableFetchable+Neis.swift deleted file mode 100644 index c2b2cc0..0000000 --- a/Sources/AsyncNeiSwift/ElsTimeTable/AsyncElsTimeTableFetchable+Neis.swift +++ /dev/null @@ -1,39 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncElsTimeTableFetchable where Self: NeisRequestable { - func fetchElsTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) async throws -> [ElsTimeTableResponse] { - try await withCheckedThrowingContinuation { continuation in - self.fetchElsTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - GRADE: GRADE, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD, - completion: continuation.resume(with:) - ) - } - } -} diff --git a/Sources/AsyncNeiSwift/ElsTimeTable/AsyncElsTimeTableFetchable+default.swift b/Sources/AsyncNeiSwift/ElsTimeTable/AsyncElsTimeTableFetchable+default.swift deleted file mode 100644 index cd95a9e..0000000 --- a/Sources/AsyncNeiSwift/ElsTimeTable/AsyncElsTimeTableFetchable+default.swift +++ /dev/null @@ -1,78 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncElsTimeTableFetchable { - /** - 초등학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다 - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - - Returns: `[ElsTimeTableResponse]` - */ - func fetchElsTimeTable( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String - ) async throws -> [ElsTimeTableResponse] { - try await self.fetchElsTimeTable( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - SEM: nil, - ALL_TI_YMD: nil, - GRADE: nil, - CLASS_NM: nil, - PERIO: nil, - TI_FROM_YMD: nil, - TI_TO_YMD: nil - ) - } - - func fetchElsTimeTable( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - SEM: String? = nil, - ALL_TI_YMD: String? = nil, - GRADE: String? = nil, - CLASS_NM: String? = nil, - PERIO: String? = nil, - TI_FROM_YMD: String? = nil, - TI_TO_YMD: String? = nil - ) async throws -> [ElsTimeTableResponse] { - try await self.fetchElsTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - GRADE: GRADE, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD - ) - } -} diff --git a/Sources/AsyncNeiSwift/ElsTimeTable/AsyncElsTimeTableFetchable.swift b/Sources/AsyncNeiSwift/ElsTimeTable/AsyncElsTimeTableFetchable.swift deleted file mode 100644 index 7c9625f..0000000 --- a/Sources/AsyncNeiSwift/ElsTimeTable/AsyncElsTimeTableFetchable.swift +++ /dev/null @@ -1,40 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol AsyncElsTimeTableFetchable: ElsTimeTableFetchable { - /** - 초등학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다 - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - - Returns: `[ElsTimeTableResponse]` - */ - func fetchElsTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) async throws -> [ElsTimeTableResponse] -} diff --git a/Sources/AsyncNeiSwift/HisTimeTable/AsyncHisTimeTableFetchable+Neis.swift b/Sources/AsyncNeiSwift/HisTimeTable/AsyncHisTimeTableFetchable+Neis.swift deleted file mode 100644 index c242b01..0000000 --- a/Sources/AsyncNeiSwift/HisTimeTable/AsyncHisTimeTableFetchable+Neis.swift +++ /dev/null @@ -1,39 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncHisTimeTableFetchable where Self: NeisRequestable { - func fetchHisTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) async throws -> [HisTimeTableResponse] { - try await withCheckedThrowingContinuation { continuation in - self.fetchHisTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - GRADE: GRADE, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD, - completion: continuation.resume(with:) - ) - } - } -} diff --git a/Sources/AsyncNeiSwift/HisTimeTable/AsyncHisTimeTableFetchable+default.swift b/Sources/AsyncNeiSwift/HisTimeTable/AsyncHisTimeTableFetchable+default.swift deleted file mode 100644 index d199f15..0000000 --- a/Sources/AsyncNeiSwift/HisTimeTable/AsyncHisTimeTableFetchable+default.swift +++ /dev/null @@ -1,78 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncHisTimeTableFetchable { - /** - 고등학교 학년도, 학교, 계열, 학과, 학기, 학년, 강의실, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - - Returns: `[HisTimeTableResponse]` - */ - func fetchHisTimeTable( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String - ) async throws -> [HisTimeTableResponse] { - try await self.fetchHisTimeTable( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - SEM: nil, - ALL_TI_YMD: nil, - GRADE: nil, - CLASS_NM: nil, - PERIO: nil, - TI_FROM_YMD: nil, - TI_TO_YMD: nil - ) - } - - func fetchHisTimeTable( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - SEM: String? = nil, - ALL_TI_YMD: String? = nil, - GRADE: String? = nil, - CLASS_NM: String? = nil, - PERIO: String? = nil, - TI_FROM_YMD: String? = nil, - TI_TO_YMD: String? = nil - ) async throws -> [HisTimeTableResponse] { - try await self.fetchHisTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - GRADE: GRADE, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD - ) - } -} diff --git a/Sources/AsyncNeiSwift/HisTimeTable/AsyncHisTimeTableFetchable.swift b/Sources/AsyncNeiSwift/HisTimeTable/AsyncHisTimeTableFetchable.swift deleted file mode 100644 index 1ce5d05..0000000 --- a/Sources/AsyncNeiSwift/HisTimeTable/AsyncHisTimeTableFetchable.swift +++ /dev/null @@ -1,40 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol AsyncHisTimeTableFetchable: HisTimeTableFetchable { - /** - 고등학교 학년도, 학교, 계열, 학과, 학기, 학년, 강의실, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - - Returns: `[HisTimeTableResponse]` - */ - func fetchHisTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) async throws -> [HisTimeTableResponse] -} diff --git a/Sources/AsyncNeiSwift/MealInfo/AsyncMealInfoFetchable+Neis.swift b/Sources/AsyncNeiSwift/MealInfo/AsyncMealInfoFetchable+Neis.swift deleted file mode 100644 index bdf9daa..0000000 --- a/Sources/AsyncNeiSwift/MealInfo/AsyncMealInfoFetchable+Neis.swift +++ /dev/null @@ -1,31 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncMealInfoFetchable where Self: NeisRequestable { - func fetchMealInfo( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - MMEAL_SC_CODE: String?, - MLSV_YMD: String?, - MLSV_FROM_YMD: String?, - MLSV_TO_YMD: String? - ) async throws -> [MealInfoResponse] { - try await withCheckedThrowingContinuation { continuation in - self.fetchMealInfo( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - MMEAL_SC_CODE: MMEAL_SC_CODE, - MLSV_YMD: MLSV_YMD, - MLSV_FROM_YMD: MLSV_FROM_YMD, - MLSV_TO_YMD: MLSV_TO_YMD, - completion: continuation.resume(with:) - ) - } - } -} diff --git a/Sources/AsyncNeiSwift/MealInfo/AsyncMealInfoFetchable+default.swift b/Sources/AsyncNeiSwift/MealInfo/AsyncMealInfoFetchable+default.swift deleted file mode 100644 index dc9160b..0000000 --- a/Sources/AsyncNeiSwift/MealInfo/AsyncMealInfoFetchable+default.swift +++ /dev/null @@ -1,63 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncMealInfoFetchable { - /** - 학교에서 제공하는 현재년도 급식의 요리명, 원산지정보, 칼로리정보, 영양정보 등의 일자별 현황입니다. - - * 요리명에 표시된 번호는 알레르기를 유발할수 있는 식재료입니다 (1.난류, 2.우유, 3.메밀, 4.땅콩, 5.대두, 6.밀, 7.고등어, 8.게, 9.새우, 10.돼지고기, 11.복숭아, 12.토마토, 13.아황산염, 14.호두, 15.닭고기, 16.쇠고기, 17.오징어, 18.조개류(굴,전복,홍합 등) - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - MMEAL_SC_CODE: (Optional) 식사코드 - - MLSV_YMD: (Optional) 급식일자 - - MLSV_FROM_YMD: (Optional) 급식일자(시작일자) - - MLSV_TO_YMD: (Optional) 급식일자(종료일자) - - completion: `Result<[MealInfoResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchMealInfo( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String - ) async throws -> [MealInfoResponse] { - try await self.fetchMealInfo( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - MMEAL_SC_CODE: nil, - MLSV_YMD: nil, - MLSV_FROM_YMD: nil, - MLSV_TO_YMD: nil - ) - } - - func fetchMealInfo( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - MMEAL_SC_CODE: String? = nil, - MLSV_YMD: String? = nil, - MLSV_FROM_YMD: String? = nil, - MLSV_TO_YMD: String? = nil - ) async throws -> [MealInfoResponse] { - try await self.fetchMealInfo( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - MMEAL_SC_CODE: MMEAL_SC_CODE, - MLSV_YMD: MLSV_YMD, - MLSV_FROM_YMD: MLSV_FROM_YMD, - MLSV_TO_YMD: MLSV_TO_YMD - ) - } -} diff --git a/Sources/AsyncNeiSwift/MealInfo/AsyncMealInfoFetchable.swift b/Sources/AsyncNeiSwift/MealInfo/AsyncMealInfoFetchable.swift deleted file mode 100644 index 86458c6..0000000 --- a/Sources/AsyncNeiSwift/MealInfo/AsyncMealInfoFetchable.swift +++ /dev/null @@ -1,34 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol AsyncMealInfoFetchable: MealInfoFetchable { - /** - 학교에서 제공하는 현재년도 급식의 요리명, 원산지정보, 칼로리정보, 영양정보 등의 일자별 현황입니다. - - * 요리명에 표시된 번호는 알레르기를 유발할수 있는 식재료입니다 (1.난류, 2.우유, 3.메밀, 4.땅콩, 5.대두, 6.밀, 7.고등어, 8.게, 9.새우, 10.돼지고기, 11.복숭아, 12.토마토, 13.아황산염, 14.호두, 15.닭고기, 16.쇠고기, 17.오징어, 18.조개류(굴,전복,홍합 등) - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - MMEAL_SC_CODE: (Optional) 식사코드 - - MLSV_YMD: (Optional) 급식일자 - - MLSV_FROM_YMD: (Optional) 급식일자(시작일자) - - MLSV_TO_YMD: (Optional) 급식일자(종료일자) - - - Returns: `[MealInfoResponse]` - */ - func fetchMealInfo( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - MMEAL_SC_CODE: String?, - MLSV_YMD: String?, - MLSV_FROM_YMD: String?, - MLSV_TO_YMD: String? - ) async throws -> [MealInfoResponse] -} diff --git a/Sources/AsyncNeiSwift/MisTimeTable/AsyncMisTimeTableFetchable+Neis.swift b/Sources/AsyncNeiSwift/MisTimeTable/AsyncMisTimeTableFetchable+Neis.swift deleted file mode 100644 index 289f981..0000000 --- a/Sources/AsyncNeiSwift/MisTimeTable/AsyncMisTimeTableFetchable+Neis.swift +++ /dev/null @@ -1,40 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncMisTimeTableFetchable where Self: NeisRequestable { - func fetchMisTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) async throws -> [MisTimeTableResponse] { - try await withCheckedThrowingContinuation { continuation in - self.fetchMisTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - GRADE: GRADE, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD, - completion: continuation.resume(with:) - ) - } - } -} - diff --git a/Sources/AsyncNeiSwift/MisTimeTable/AsyncMisTimeTableFetchable+default.swift b/Sources/AsyncNeiSwift/MisTimeTable/AsyncMisTimeTableFetchable+default.swift deleted file mode 100644 index 2c03fe3..0000000 --- a/Sources/AsyncNeiSwift/MisTimeTable/AsyncMisTimeTableFetchable+default.swift +++ /dev/null @@ -1,78 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncMisTimeTableFetchable { - /** - 중학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - - Returns: `[MisTimeTableResponse]` - */ - func fetchMisTimeTable( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String - ) async throws -> [MisTimeTableResponse] { - try await self.fetchMisTimeTable( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - SEM: nil, - ALL_TI_YMD: nil, - GRADE: nil, - CLASS_NM: nil, - PERIO: nil, - TI_FROM_YMD: nil, - TI_TO_YMD: nil - ) - } - - func fetchMisTimeTable( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - SEM: String? = nil, - ALL_TI_YMD: String? = nil, - GRADE: String? = nil, - CLASS_NM: String? = nil, - PERIO: String? = nil, - TI_FROM_YMD: String? = nil, - TI_TO_YMD: String? = nil - ) async throws -> [MisTimeTableResponse] { - try await self.fetchMisTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - GRADE: GRADE, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD - ) - } -} diff --git a/Sources/AsyncNeiSwift/MisTimeTable/AsyncMisTimeTableFetchable.swift b/Sources/AsyncNeiSwift/MisTimeTable/AsyncMisTimeTableFetchable.swift deleted file mode 100644 index ab2165e..0000000 --- a/Sources/AsyncNeiSwift/MisTimeTable/AsyncMisTimeTableFetchable.swift +++ /dev/null @@ -1,40 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol AsyncMisTimeTableFetchable: MisTimeTableFetchable { - /** - 중학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - - Returns: `[MisTimeTableResponse]` - */ - func fetchMisTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) async throws -> [MisTimeTableResponse] -} diff --git a/Sources/AsyncNeiSwift/Neis+Async.swift b/Sources/AsyncNeiSwift/Neis+Async.swift new file mode 100644 index 0000000..d509b77 --- /dev/null +++ b/Sources/AsyncNeiSwift/Neis+Async.swift @@ -0,0 +1,291 @@ +import NeiSwift + +extension Neis: AsyncNeisProtocol {} + +@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) +public extension AsyncNeisProtocol where Self: NeisProtocol { + /** + 개설되어있는 학원 및 교습소의 학원명, 휴원일자, 등록상태, 정원, 분야, 계열 및 과정등을 확인할 수 있으며 수강료 공개여부에 따라 수강료 내용을 확인할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - ADMST_ZONE_NM: (Optional) 행정구역명 + - ACA_ASNUM: (Optional) 학원지정번호 + - ACA_NM: (Optional) 학원명 + - REALM_SC_NM: (Optional) 분야명 + - LE_ORD_NM: (Optional) 교습계열명 + - LE_CRSE_NM: (Optional) 교습과정명 + + - Returns: `[AcaInsTiInfoResponse]` + */ + func fetchAcaInsTiList( + request: AcaInsTiInfoRequest + ) async throws -> [AcaInsTiInfoResponse] { + try await withCheckedThrowingContinuation { continuation in + self.fetchAcaInsTiList(request: request, completion: continuation.resume(with:)) + } + } + + /** + 학교명 등의 검색 조건을 선택하여 반정보를 검색할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - GRADE: (Optional) 학년 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 + - ORD_SC_NM: (Optional) 계열명 + - DDDEP_NM: (Optional) 학과명 + + - Returns: `[ClassInfoResponse]` + */ + func fetchClassInfo( + request: ClassInfoRequest + ) async throws -> [ClassInfoResponse] { + try await withCheckedThrowingContinuation { continuation in + self.fetchClassInfo(request: request, completion: continuation.resume(with:)) + } + } + + /** + 초등학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다 + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - GRADE: (Optional) 학년 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `[ElsTimeTableResponse]` + */ + func fetchElsTimeTable( + request: ElsTimeTableRequest + ) async throws -> [ElsTimeTableResponse] { + try await withCheckedThrowingContinuation { continuation in + self.fetchElsTimeTable(request: request, completion: continuation.resume(with:)) + } + } + + /** + 고등학교 학년도, 학교, 계열, 학과, 학기, 학년, 강의실, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - GRADE: (Optional) 학년 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `[HisTimeTableResponse]` + */ + func fetchHisTimeTable( + request: HisTimeTableRequest + ) async throws -> [HisTimeTableResponse] { + try await withCheckedThrowingContinuation { continuation in + self.fetchHisTimeTable(request: request, completion: continuation.resume(with:)) + } + } + + /** + 학교에서 제공하는 현재년도 급식의 요리명, 원산지정보, 칼로리정보, 영양정보 등의 일자별 현황입니다. + + * 요리명에 표시된 번호는 알레르기를 유발할수 있는 식재료입니다 (1.난류, 2.우유, 3.메밀, 4.땅콩, 5.대두, 6.밀, 7.고등어, 8.게, 9.새우, 10.돼지고기, 11.복숭아, 12.토마토, 13.아황산염, 14.호두, 15.닭고기, 16.쇠고기, 17.오징어, 18.조개류(굴,전복,홍합 등)) + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - MMEAL_SC_CODE: (Optional) 식사코드 + - MLSV_YMD: (Optional) 급식일자 + - MLSV_FROM_YMD: (Optional) 급식일자(시작일자) + - MLSV_TO_YMD: (Optional) 급식일자(종료일자) + + - Returns: `[MealInfoResponse]` + */ + func fetchMealInfo( + request: MealInfoRequest + ) async throws -> [MealInfoResponse] { + try await withCheckedThrowingContinuation { continuation in + self.fetchMealInfo(request: request, completion: continuation.resume(with:)) + } + } + + /** + 중학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - GRADE: (Optional) 학년 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `[MisTimeTableResponse]` + */ + func fetchMisTimeTable( + request: MisTimeTableRequest + ) async throws -> [MisTimeTableResponse] { + try await withCheckedThrowingContinuation { continuation in + self.fetchMisTimeTable(request: request, completion: continuation.resume(with:)) + } + } + + /** + 학교별 학과 정보를 조회할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: (Optional) 표준학교코드 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - ORD_SC_NM: (Optional) 계열명 + + - Returns: `[SchoolDepartmentResponse]` + */ + func fetchSchoolDepartmentList( + request: SchoolDepartmentRequest + ) async throws -> [SchoolDepartmentResponse] { + try await withCheckedThrowingContinuation { continuation in + self.fetchSchoolDepartmentList(request: request, completion: continuation.resume(with:)) + } + } + + /** + 학교 기본정보에 대한 학교명, 소재지, 주소, 전화번호, 홈페이지주소, 남녀공학여부, 주야구분, 개교기념일 등을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: (Optional) 시도교육청코드 + - SD_SCHUL_CODE: (Optional) 표준학교코드 + - SCHUL_NM: (Optional) 학교명 + - SCHUL_KND_SC_NM: (Optional) 학교 종류명 + - LCTN_SC_NM: (Optional) 소재지명 + - FOND_SC_NM: (Optional) 설립명 + + - Returns: `[SchoolInfoResponse]` + */ + func fetchSchoolList( + request: SchoolInfoRequest + ) async throws -> [SchoolInfoResponse] { + try await withCheckedThrowingContinuation { continuation in + self.fetchSchoolList(request: request, completion: continuation.resume(with:)) + } + } + + /** + 학교명 등의 검색 조건을 선택하여 학교계열정보를 검색할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: (Optional) 표준학교코드 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + + - Returns: `[SchulAflcoinfoResponse]` + */ + func fetchSchulAflcoinfoList( + request: SchulAflcoinfoRequest + ) async throws -> [SchulAflcoinfoResponse] { + try await withCheckedThrowingContinuation { continuation in + self.fetchSchulAflcoinfoList(request: request, completion: continuation.resume(with:)) + } + } + + /** + 특수학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 + - GRADE: (Optional) 학년 + - CLRM_NM: (Optional) 강의실명 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `[SpsTimeTableResponse]` + */ + func fetchSpsTimeTable( + request: SpsTimeTableRequest + ) async throws -> [SpsTimeTableResponse] { + try await withCheckedThrowingContinuation { continuation in + self.fetchSpsTimeTable(request: request, completion: continuation.resume(with:)) + } + } + + /** + 학교명 등의 검색 조건을 선택하여 시간표강의실 정보를 검색 할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 번호 + - pSize: 한 페이지 결과 수 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 학교코드 + - AY: (Optional) 학년도 + - GRADE: (Optional) 학년 + - SEM: (Optional) 학기 + - SCHUL_CRSE_SC_NM: (Optional) 학교종류명 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - ORD_SC_NM: (Optional) 계열명 + - DDDEP_NM: (Optional) 학과명 + + - Returns: `[TimeTableClassRoomInfoResponse]` + */ + func fetchTimeTableClassRoom( + request: TimeTableClassRoomInfoRequest + ) async throws -> [TimeTableClassRoomInfoResponse] { + try await withCheckedThrowingContinuation { continuation in + self.fetchTimeTableClassRoom(request: request, completion: continuation.resume(with:)) + } + } +} diff --git a/Sources/AsyncNeiSwift/Neis+AsyncAdoption.swift b/Sources/AsyncNeiSwift/Neis+AsyncAdoption.swift deleted file mode 100644 index 4e38b2d..0000000 --- a/Sources/AsyncNeiSwift/Neis+AsyncAdoption.swift +++ /dev/null @@ -1,14 +0,0 @@ -import NeiSwift - -extension Neis: - AsyncAcaInsTiInfoFetchable, - AsyncClassInfoFetchable, - AsyncElsTimeTableFetchable, - AsyncHisTimeTableFetchable, - AsyncMealInfoFetchable, - AsyncMisTimeTableFetchable, - AsyncSchoolDepartmentFetchable, - AsyncSchoolInfoFetchable, - AsyncSchulAflcoinfoFetchable, - AsyncSpsTimeTableFetchable, - AsyncTimeTableClassRoomInfoFetchable {} diff --git a/Sources/AsyncNeiSwift/SchoolDepartment/AsyncSchoolDepartmentFetchable+Neis.swift b/Sources/AsyncNeiSwift/SchoolDepartment/AsyncSchoolDepartmentFetchable+Neis.swift deleted file mode 100644 index 98ef38a..0000000 --- a/Sources/AsyncNeiSwift/SchoolDepartment/AsyncSchoolDepartmentFetchable+Neis.swift +++ /dev/null @@ -1,27 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncSchoolDepartmentFetchable where Self: NeisRequestable { - func fetchSchoolDepartmentList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String?, - DGHT_CRSE_SC_NM: String?, - ORD_SC_NM: String? - ) async throws -> [SchoolDepartmentResponse] { - try await withCheckedThrowingContinuation { continuation in - fetchSchoolDepartmentList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - ORD_SC_NM: ORD_SC_NM, - completion: continuation.resume(with:) - ) - } - } -} diff --git a/Sources/AsyncNeiSwift/SchoolDepartment/AsyncSchoolDepartmentFetchable+default.swift b/Sources/AsyncNeiSwift/SchoolDepartment/AsyncSchoolDepartmentFetchable+default.swift deleted file mode 100644 index 40855cf..0000000 --- a/Sources/AsyncNeiSwift/SchoolDepartment/AsyncSchoolDepartmentFetchable+default.swift +++ /dev/null @@ -1,53 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncSchoolDepartmentFetchable { - /** - 학교별 학과 정보를 조회할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - ORD_SC_NM: (Optional) 계열명 - - - Returns: `[SchoolDepartmentResponse]` - */ - func fetchSchoolDepartmentList( - key: String, - ATPT_OFCDC_SC_CODE: String - ) async throws -> [SchoolDepartmentResponse] { - try await self.fetchSchoolDepartmentList( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: nil, - DGHT_CRSE_SC_NM: nil, - ORD_SC_NM: nil - ) - } - - func fetchSchoolDepartmentList( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String? = nil, - DGHT_CRSE_SC_NM: String? = nil, - ORD_SC_NM: String? = nil - ) async throws -> [SchoolDepartmentResponse] { - try await self.fetchSchoolDepartmentList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - ORD_SC_NM: ORD_SC_NM - ) - } -} diff --git a/Sources/AsyncNeiSwift/SchoolDepartment/AsyncSchoolDepartmentFetchable.swift b/Sources/AsyncNeiSwift/SchoolDepartment/AsyncSchoolDepartmentFetchable.swift deleted file mode 100644 index aa6adcd..0000000 --- a/Sources/AsyncNeiSwift/SchoolDepartment/AsyncSchoolDepartmentFetchable.swift +++ /dev/null @@ -1,28 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol AsyncSchoolDepartmentFetchable: SchoolDepartmentFetchable { - /** - 학교별 학과 정보를 조회할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - ORD_SC_NM: (Optional) 계열명 - - - Returns: `[SchoolDepartmentResponse]` - */ - func fetchSchoolDepartmentList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String?, - DGHT_CRSE_SC_NM: String?, - ORD_SC_NM: String? - ) async throws -> [SchoolDepartmentResponse] -} diff --git a/Sources/AsyncNeiSwift/SchoolInfo/AsyncSchoolInfoFetchable+Neis.swift b/Sources/AsyncNeiSwift/SchoolInfo/AsyncSchoolInfoFetchable+Neis.swift deleted file mode 100644 index 72328eb..0000000 --- a/Sources/AsyncNeiSwift/SchoolInfo/AsyncSchoolInfoFetchable+Neis.swift +++ /dev/null @@ -1,31 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncSchoolInfoFetchable where Self: NeisRequestable { - func fetchSchoolList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String?, - SD_SCHUL_CODE: String?, - SCHUL_NM: String?, - SCHUL_KND_SC_NM: String?, - LCTN_SC_NM: String?, - FOND_SC_NM: String? - ) async throws -> [SchoolInfoResponse] { - try await withCheckedThrowingContinuation { continuation in - self.fetchSchoolList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - SCHUL_NM: SCHUL_NM, - SCHUL_KND_SC_NM: SCHUL_KND_SC_NM, - LCTN_SC_NM: LCTN_SC_NM, - FOND_SC_NM: FOND_SC_NM, - completion: continuation.resume(with:) - ) - } - } -} diff --git a/Sources/AsyncNeiSwift/SchoolInfo/AsyncSchoolInfoFetchable+default.swift b/Sources/AsyncNeiSwift/SchoolInfo/AsyncSchoolInfoFetchable+default.swift deleted file mode 100644 index 33fe618..0000000 --- a/Sources/AsyncNeiSwift/SchoolInfo/AsyncSchoolInfoFetchable+default.swift +++ /dev/null @@ -1,60 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncSchoolInfoFetchable { - /** - 학교 기본정보에 대한 학교명, 소재지, 주소, 전화번호, 홈페이지주소, 남녀공학여부, 주야구분, 개교기념일 등을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: (Optional) 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - SCHUL_NM: (Optional) 학교명 - - SCHUL_KND_SC_NM: (Optional) 학교 종류명 - - LCTN_SC_NM: (Optional) 소재지명 - - FOND_SC_NM: (Optional) 설립명 - - - Returns: `[SchoolInfoResponse]` - */ - func fetchSchoolList( - key: String - ) async throws -> [SchoolInfoResponse] { - try await self.fetchSchoolList( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: nil, - SD_SCHUL_CODE: nil, - SCHUL_NM: nil, - SCHUL_KND_SC_NM: nil, - LCTN_SC_NM: nil, - FOND_SC_NM: nil - ) - } - - func fetchSchoolList( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String? = nil, - SD_SCHUL_CODE: String? = nil, - SCHUL_NM: String? = nil, - SCHUL_KND_SC_NM: String? = nil, - LCTN_SC_NM: String? = nil, - FOND_SC_NM: String? = nil - ) async throws -> [SchoolInfoResponse] { - try await self.fetchSchoolList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - SCHUL_NM: SCHUL_NM, - SCHUL_KND_SC_NM: SCHUL_KND_SC_NM, - LCTN_SC_NM: LCTN_SC_NM, - FOND_SC_NM: FOND_SC_NM - ) - } -} diff --git a/Sources/AsyncNeiSwift/SchoolInfo/AsyncSchoolInfoFetchable.swift b/Sources/AsyncNeiSwift/SchoolInfo/AsyncSchoolInfoFetchable.swift deleted file mode 100644 index 6bbcbdd..0000000 --- a/Sources/AsyncNeiSwift/SchoolInfo/AsyncSchoolInfoFetchable.swift +++ /dev/null @@ -1,32 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol AsyncSchoolInfoFetchable: SchoolInfoFetchable { - /** - 학교 기본정보에 대한 학교명, 소재지, 주소, 전화번호, 홈페이지주소, 남녀공학여부, 주야구분, 개교기념일 등을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: (Optional) 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - SCHUL_NM: (Optional) 학교명 - - SCHUL_KND_SC_NM: (Optional) 학교 종류명 - - LCTN_SC_NM: (Optional) 소재지명 - - FOND_SC_NM: (Optional) 설립명 - - - Returns: `[SchoolInfoResponse]` - */ - func fetchSchoolList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String?, - SD_SCHUL_CODE: String?, - SCHUL_NM: String?, - SCHUL_KND_SC_NM: String?, - LCTN_SC_NM: String?, - FOND_SC_NM: String? - ) async throws -> [SchoolInfoResponse] -} diff --git a/Sources/AsyncNeiSwift/SchulAflcoinfo/AsyncSchulAflcoinfoFetchable+Neis.swift b/Sources/AsyncNeiSwift/SchulAflcoinfo/AsyncSchulAflcoinfoFetchable+Neis.swift deleted file mode 100644 index 3813160..0000000 --- a/Sources/AsyncNeiSwift/SchulAflcoinfo/AsyncSchulAflcoinfoFetchable+Neis.swift +++ /dev/null @@ -1,25 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncSchulAflcoinfoFetchable where Self: NeisRequestable { - func fetchSchulAflcoinfoList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String?, - DGHT_CRSE_SC_NM: String? - ) async throws -> [SchulAflcoinfoResponse] { - try await withCheckedThrowingContinuation { continuation in - self.fetchSchulAflcoinfoList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - completion: continuation.resume(with:) - ) - } - } -} diff --git a/Sources/AsyncNeiSwift/SchulAflcoinfo/AsyncSchulAflcoinfoFetchable+default.swift b/Sources/AsyncNeiSwift/SchulAflcoinfo/AsyncSchulAflcoinfoFetchable+default.swift deleted file mode 100644 index 8680b0d..0000000 --- a/Sources/AsyncNeiSwift/SchulAflcoinfo/AsyncSchulAflcoinfoFetchable+default.swift +++ /dev/null @@ -1,49 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncSchulAflcoinfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 학교계열정보를 검색할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - - Returns: `[SchulAflcoinfoResponse]` - */ - func fetchSchulAflcoinfoList( - key: String, - ATPT_OFCDC_SC_CODE: String - ) async throws -> [SchulAflcoinfoResponse] { - try await self.fetchSchulAflcoinfoList( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: nil, - DGHT_CRSE_SC_NM: nil - ) - } - - func fetchSchulAflcoinfoList( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String? = nil, - DGHT_CRSE_SC_NM: String? = nil - ) async throws -> [SchulAflcoinfoResponse] { - try await self.fetchSchulAflcoinfoList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM - ) - } -} diff --git a/Sources/AsyncNeiSwift/SchulAflcoinfo/AsyncSchulAflcoinfoFetchable.swift b/Sources/AsyncNeiSwift/SchulAflcoinfo/AsyncSchulAflcoinfoFetchable.swift deleted file mode 100644 index 9072266..0000000 --- a/Sources/AsyncNeiSwift/SchulAflcoinfo/AsyncSchulAflcoinfoFetchable.swift +++ /dev/null @@ -1,26 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol AsyncSchulAflcoinfoFetchable: SchulAflcoinfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 학교계열정보를 검색할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - - Returns: `[SchulAflcoinfoResponse]` - */ - func fetchSchulAflcoinfoList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String?, - DGHT_CRSE_SC_NM: String? - ) async throws -> [SchulAflcoinfoResponse] -} diff --git a/Sources/AsyncNeiSwift/SpsTimeTable/AsyncSpsTimeTableFetchable+Neis.swift b/Sources/AsyncNeiSwift/SpsTimeTable/AsyncSpsTimeTableFetchable+Neis.swift deleted file mode 100644 index 8b60da4..0000000 --- a/Sources/AsyncNeiSwift/SpsTimeTable/AsyncSpsTimeTableFetchable+Neis.swift +++ /dev/null @@ -1,43 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncSpsTimeTableFetchable where Self: NeisRequestable { - func fetchSpsTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - SCHUL_CRSE_SC_NM: String?, - GRADE: String?, - CLRM_NM: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) async throws -> [SpsTimeTableResponse] { - try await withCheckedThrowingContinuation { continuation in - self.fetchSpsTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - SCHUL_CRSE_SC_NM: SCHUL_CRSE_SC_NM, - GRADE: GRADE, - CLRM_NM: CLRM_NM, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD, - completion: continuation.resume(with:) - ) - } - } -} diff --git a/Sources/AsyncNeiSwift/SpsTimeTable/AsyncSpsTimeTableFetchable+default.swift b/Sources/AsyncNeiSwift/SpsTimeTable/AsyncSpsTimeTableFetchable+default.swift deleted file mode 100644 index c10c783..0000000 --- a/Sources/AsyncNeiSwift/SpsTimeTable/AsyncSpsTimeTableFetchable+default.swift +++ /dev/null @@ -1,64 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncSpsTimeTableFetchable { - func fetchSpsTimeTable( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String - ) async throws -> [SpsTimeTableResponse] { - try await self.fetchSpsTimeTable( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - SEM: nil, - ALL_TI_YMD: nil, - SCHUL_CRSE_SC_NM: nil, - GRADE: nil, - CLRM_NM: nil, - CLASS_NM: nil, - PERIO: nil, - TI_FROM_YMD: nil, - TI_TO_YMD: nil - ) - } - - func fetchSpsTimeTable( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - SEM: String? = nil, - ALL_TI_YMD: String? = nil, - SCHUL_CRSE_SC_NM: String? = nil, - GRADE: String? = nil, - CLRM_NM: String? = nil, - CLASS_NM: String? = nil, - PERIO: String? = nil, - TI_FROM_YMD: String? = nil, - TI_TO_YMD: String? = nil - ) async throws -> [SpsTimeTableResponse] { - try await self.fetchSpsTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - SCHUL_CRSE_SC_NM: SCHUL_CRSE_SC_NM, - GRADE: GRADE, - CLRM_NM: CLRM_NM, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD - ) - } -} diff --git a/Sources/AsyncNeiSwift/SpsTimeTable/AsyncSpsTimeTableFetchable.swift b/Sources/AsyncNeiSwift/SpsTimeTable/AsyncSpsTimeTableFetchable.swift deleted file mode 100644 index cfb6a19..0000000 --- a/Sources/AsyncNeiSwift/SpsTimeTable/AsyncSpsTimeTableFetchable.swift +++ /dev/null @@ -1,44 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol AsyncSpsTimeTableFetchable: SpsTimeTableFetchable { - /** - 특수학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 - - GRADE: (Optional) 학년 - - CLRM_NM: (Optional) 강의실명 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - - Returns: `[SpsTimeTableResponse]` - */ - func fetchSpsTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - SCHUL_CRSE_SC_NM: String?, - GRADE: String?, - CLRM_NM: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) async throws -> [SpsTimeTableResponse] -} diff --git a/Sources/AsyncNeiSwift/TimeTableClassRoomInfoFetchable/AsyncTimeTableClassRoomInfoFetchable+Neis.swift b/Sources/AsyncNeiSwift/TimeTableClassRoomInfoFetchable/AsyncTimeTableClassRoomInfoFetchable+Neis.swift deleted file mode 100644 index f8c81b0..0000000 --- a/Sources/AsyncNeiSwift/TimeTableClassRoomInfoFetchable/AsyncTimeTableClassRoomInfoFetchable+Neis.swift +++ /dev/null @@ -1,37 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncTimeTableClassRoomInfoFetchable where Self: NeisRequestable { - func fetchTimeTableClassRoom( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - GRADE: String?, - SEM: String?, - SCHUL_CRSE_SC_NM: String?, - DGHT_CRSE_SC_NM: String?, - ORD_SC_NM: String?, - DDDEP_NM: String? - ) async throws -> [TimeTableClassRoomInfoResponse] { - try await withCheckedThrowingContinuation { continuation in - self.fetchTimeTableClassRoom( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - GRADE: GRADE, - SEM: SEM, - SCHUL_CRSE_SC_NM: SCHUL_CRSE_SC_NM, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - ORD_SC_NM: ORD_SC_NM, - DDDEP_NM: DDDEP_NM, - completion: continuation.resume(with:) - ) - } - } -} diff --git a/Sources/AsyncNeiSwift/TimeTableClassRoomInfoFetchable/AsyncTimeTableClassRoomInfoFetchable+default.swift b/Sources/AsyncNeiSwift/TimeTableClassRoomInfoFetchable/AsyncTimeTableClassRoomInfoFetchable+default.swift deleted file mode 100644 index b1b1bbd..0000000 --- a/Sources/AsyncNeiSwift/TimeTableClassRoomInfoFetchable/AsyncTimeTableClassRoomInfoFetchable+default.swift +++ /dev/null @@ -1,74 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension AsyncTimeTableClassRoomInfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 시간표강의실 정보를 검색 할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 번호 - - pSize: 한 페이지 결과 수 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 학교코드 - - AY: (Optional) 학년도 - - GRADE: (Optional) 학년 - - SEM: (Optional) 학기 - - SCHUL_CRSE_SC_NM: (Optional) 학교종류명 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - ORD_SC_NM: (Optional) 계열명 - - DDDEP_NM: (Optional) 학과명 - - - Returns: `[TimeTableClassRoomInfoResponse]` - */ - func fetchTimeTableClassRoom( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String - ) async throws -> [TimeTableClassRoomInfoResponse] { - try await self.fetchTimeTableClassRoom( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - GRADE: nil, - SEM: nil, - SCHUL_CRSE_SC_NM: nil, - DGHT_CRSE_SC_NM: nil, - ORD_SC_NM: nil, - DDDEP_NM: nil - ) - } - - func fetchTimeTableClassRoom( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - GRADE: String? = nil, - SEM: String? = nil, - SCHUL_CRSE_SC_NM: String? = nil, - DGHT_CRSE_SC_NM: String? = nil, - ORD_SC_NM: String? = nil, - DDDEP_NM: String? = nil - ) async throws -> [TimeTableClassRoomInfoResponse] { - try await self.fetchTimeTableClassRoom( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - GRADE: GRADE, - SEM: SEM, - SCHUL_CRSE_SC_NM: SCHUL_CRSE_SC_NM, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - ORD_SC_NM: ORD_SC_NM, - DDDEP_NM: DDDEP_NM - ) - } -} diff --git a/Sources/AsyncNeiSwift/TimeTableClassRoomInfoFetchable/AsyncTimeTableClassRoomInfoFetchable.swift b/Sources/AsyncNeiSwift/TimeTableClassRoomInfoFetchable/AsyncTimeTableClassRoomInfoFetchable.swift deleted file mode 100644 index 0314ade..0000000 --- a/Sources/AsyncNeiSwift/TimeTableClassRoomInfoFetchable/AsyncTimeTableClassRoomInfoFetchable.swift +++ /dev/null @@ -1,38 +0,0 @@ -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol AsyncTimeTableClassRoomInfoFetchable: TimeTableClassRoomInfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 시간표강의실 정보를 검색 할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 번호 - - pSize: 한 페이지 결과 수 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 학교코드 - - AY: (Optional) 학년도 - - GRADE: (Optional) 학년 - - SEM: (Optional) 학기 - - SCHUL_CRSE_SC_NM: (Optional) 학교종류명 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - ORD_SC_NM: (Optional) 계열명 - - DDDEP_NM: (Optional) 학과명 - - - Returns: `[TimeTableClassRoomInfoResponse]` - */ - func fetchTimeTableClassRoom( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - GRADE: String?, - SEM: String?, - SCHUL_CRSE_SC_NM: String?, - DGHT_CRSE_SC_NM: String?, - ORD_SC_NM: String?, - DDDEP_NM: String? - ) async throws -> [TimeTableClassRoomInfoResponse] -} diff --git a/Sources/CombineNeiSwift/AcaInsTiInfo/CombineAcaInsTiInfoFetchable+Neis.swift b/Sources/CombineNeiSwift/AcaInsTiInfo/CombineAcaInsTiInfoFetchable+Neis.swift deleted file mode 100644 index 39d5a76..0000000 --- a/Sources/CombineNeiSwift/AcaInsTiInfo/CombineAcaInsTiInfoFetchable+Neis.swift +++ /dev/null @@ -1,37 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineAcaInsTiInfoFetchable where Self: NeisRequestable { - func fetchAcaInsTiListPublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - ADMST_ZONE_NM: String?, - ACA_ASNUM: String?, - ACA_NM: String?, - REALM_SC_NM: String?, - LE_ORD_NM: String?, - LE_CRSE_NM: String? - ) -> AnyPublisher<[AcaInsTiInfoResponse], Error> { - Deferred { - Future { fullfill in - self.fetchAcaInsTiList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - ADMST_ZONE_NM: ADMST_ZONE_NM, - ACA_ASNUM: ACA_ASNUM, - ACA_NM: ACA_NM, - REALM_SC_NM: REALM_SC_NM, - LE_ORD_NM: LE_ORD_NM, - LE_CRSE_NM: LE_CRSE_NM, - completion: fullfill - ) - } - } - .eraseToAnyPublisher() - } -} diff --git a/Sources/CombineNeiSwift/AcaInsTiInfo/CombineAcaInsTiInfoFetchable+default.swift b/Sources/CombineNeiSwift/AcaInsTiInfo/CombineAcaInsTiInfoFetchable+default.swift deleted file mode 100644 index 434bfdc..0000000 --- a/Sources/CombineNeiSwift/AcaInsTiInfo/CombineAcaInsTiInfoFetchable+default.swift +++ /dev/null @@ -1,66 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineAcaInsTiInfoFetchable { - /** - 개설되어있는 학원 및 교습소의 학원명, 휴원일자, 등록상태, 정원, 분야, 계열 및 과정등을 확인할 수 있으며 수강료 공개여부에 따라 수강료 내용을 확인할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - ADMST_ZONE_NM: (Optional) 행정구역명 - - ACA_ASNUM: (Optional) 학원지정번호 - - ACA_NM: (Optional) 학원명 - - REALM_SC_NM: (Optional) 분야명 - - LE_ORD_NM: (Optional) 교습계열명 - - LE_CRSE_NM: (Optional) 교습과정명 - - - Returns: `AnyPublisher<[AcaInsTiInfoResponse], Error>` - */ - func fetchAcaInsTiListPublisher( - key: String, - ATPT_OFCDC_SC_CODE: String - ) -> AnyPublisher<[AcaInsTiInfoResponse], Error> { - self.fetchAcaInsTiListPublisher( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - ADMST_ZONE_NM: nil, - ACA_ASNUM: nil, - ACA_NM: nil, - REALM_SC_NM: nil, - LE_ORD_NM: nil, - LE_CRSE_NM: nil - ) - } - - func fetchAcaInsTiListPublisher( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - ADMST_ZONE_NM: String? = nil, - ACA_ASNUM: String? = nil, - ACA_NM: String? = nil, - REALM_SC_NM: String? = nil, - LE_ORD_NM: String? = nil, - LE_CRSE_NM: String? = nil - ) -> AnyPublisher<[AcaInsTiInfoResponse], Error> { - self.fetchAcaInsTiListPublisher( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - ADMST_ZONE_NM: ADMST_ZONE_NM, - ACA_ASNUM: ACA_ASNUM, - ACA_NM: ACA_NM, - REALM_SC_NM: REALM_SC_NM, - LE_ORD_NM: LE_ORD_NM, - LE_CRSE_NM: LE_CRSE_NM - ) - } -} diff --git a/Sources/CombineNeiSwift/AcaInsTiInfo/CombineAcaInsTiInfoFetchable.swift b/Sources/CombineNeiSwift/AcaInsTiInfo/CombineAcaInsTiInfoFetchable.swift deleted file mode 100644 index 9d5c577..0000000 --- a/Sources/CombineNeiSwift/AcaInsTiInfo/CombineAcaInsTiInfoFetchable.swift +++ /dev/null @@ -1,35 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol CombineAcaInsTiInfoFetchable: AcaInsTiInfoFetchable { - /** - 개설되어있는 학원 및 교습소의 학원명, 휴원일자, 등록상태, 정원, 분야, 계열 및 과정등을 확인할 수 있으며 수강료 공개여부에 따라 수강료 내용을 확인할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - ADMST_ZONE_NM: (Optional) 행정구역명 - - ACA_ASNUM: (Optional) 학원지정번호 - - ACA_NM: (Optional) 학원명 - - REALM_SC_NM: (Optional) 분야명 - - LE_ORD_NM: (Optional) 교습계열명 - - LE_CRSE_NM: (Optional) 교습과정명 - - - Returns: `AnyPublisher<[AcaInsTiInfoResponse], Error>` - */ - func fetchAcaInsTiListPublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, /// 시도 교육청 코드 - ADMST_ZONE_NM: String?, /// 행정구역명 - ACA_ASNUM: String?, /// 학원지정번호 - ACA_NM: String?, /// 학원명 - REALM_SC_NM: String?, /// 분야명 - LE_ORD_NM: String?, /// 교습계열명 - LE_CRSE_NM: String? /// 교습과정명 - ) -> AnyPublisher<[AcaInsTiInfoResponse], Error> -} diff --git a/Sources/CombineNeiSwift/ClassInfo/CombineClassInfoFetchable+Neis.swift b/Sources/CombineNeiSwift/ClassInfo/CombineClassInfoFetchable+Neis.swift deleted file mode 100644 index 8779afb..0000000 --- a/Sources/CombineNeiSwift/ClassInfo/CombineClassInfoFetchable+Neis.swift +++ /dev/null @@ -1,39 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineClassInfoFetchable where Self: NeisRequestable { - func fetchClassInfoPublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - GRADE: String?, - DGHT_CRSE_SC_NM: String?, - SCHUL_CRSE_SC_NM: String?, - ORD_SC_NM: String?, - DDDEP_NM: String? - ) -> AnyPublisher<[ClassInfoResponse], Error> { - Deferred { - Future { fullfill in - fetchClassInfo( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - GRADE: GRADE, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - SCHUL_CRSE_SC_NM: SCHUL_CRSE_SC_NM, - ORD_SC_NM: ORD_SC_NM, - DDDEP_NM: DDDEP_NM, - completion: fullfill - ) - } - } - .eraseToAnyPublisher() - } -} diff --git a/Sources/CombineNeiSwift/ClassInfo/CombineClassInfoFetchable+default.swift b/Sources/CombineNeiSwift/ClassInfo/CombineClassInfoFetchable+default.swift deleted file mode 100644 index b71a6e4..0000000 --- a/Sources/CombineNeiSwift/ClassInfo/CombineClassInfoFetchable+default.swift +++ /dev/null @@ -1,71 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineClassInfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 반정보를 검색할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - GRADE: (Optional) 학년 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 - - ORD_SC_NM: (Optional) 계열명 - - DDDEP_NM: (Optional) 학과명 - - - Returns: `AnyPublisher<[ClassInfoResponse], Error>` - */ - func fetchClassInfoPublisher( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String - ) -> AnyPublisher<[ClassInfoResponse], Error> { - self.fetchClassInfoPublisher( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - GRADE: nil, - DGHT_CRSE_SC_NM: nil, - SCHUL_CRSE_SC_NM: nil, - ORD_SC_NM: nil, - DDDEP_NM: nil - ) - } - - func fetchClassInfoPublisher( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - GRADE: String? = nil, - DGHT_CRSE_SC_NM: String? = nil, - SCHUL_CRSE_SC_NM: String? = nil, - ORD_SC_NM: String? = nil, - DDDEP_NM: String? = nil - ) -> AnyPublisher<[ClassInfoResponse], Error> { - self.fetchClassInfoPublisher( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - GRADE: GRADE, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - SCHUL_CRSE_SC_NM: SCHUL_CRSE_SC_NM, - ORD_SC_NM: ORD_SC_NM, - DDDEP_NM: DDDEP_NM - ) - } -} diff --git a/Sources/CombineNeiSwift/ClassInfo/CombineClassInfoFetchable.swift b/Sources/CombineNeiSwift/ClassInfo/CombineClassInfoFetchable.swift deleted file mode 100644 index 9b6db12..0000000 --- a/Sources/CombineNeiSwift/ClassInfo/CombineClassInfoFetchable.swift +++ /dev/null @@ -1,37 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol CombineClassInfoFetchable: ClassInfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 반정보를 검색할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - GRADE: (Optional) 학년 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 - - ORD_SC_NM: (Optional) 계열명 - - DDDEP_NM: (Optional) 학과명 - - - Returns: `AnyPublisher<[ClassInfoResponse], Error>` - */ - func fetchClassInfoPublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - GRADE: String?, - DGHT_CRSE_SC_NM: String?, - SCHUL_CRSE_SC_NM: String?, - ORD_SC_NM: String?, - DDDEP_NM: String? - ) -> AnyPublisher<[ClassInfoResponse], Error> -} diff --git a/Sources/CombineNeiSwift/CombeNeisProtocol.swift b/Sources/CombineNeiSwift/CombeNeisProtocol.swift new file mode 100644 index 0000000..7dbba53 --- /dev/null +++ b/Sources/CombineNeiSwift/CombeNeisProtocol.swift @@ -0,0 +1,246 @@ +import Combine +import NeiSwift + +@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) +public protocol CombineNeisProtocol { + /** + 개설되어있는 학원 및 교습소의 학원명, 휴원일자, 등록상태, 정원, 분야, 계열 및 과정등을 확인할 수 있으며 수강료 공개여부에 따라 수강료 내용을 확인할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - ADMST_ZONE_NM: (Optional) 행정구역명 + - ACA_ASNUM: (Optional) 학원지정번호 + - ACA_NM: (Optional) 학원명 + - REALM_SC_NM: (Optional) 분야명 + - LE_ORD_NM: (Optional) 교습계열명 + - LE_CRSE_NM: (Optional) 교습과정명 + + - Returns: `AnyPublisher<[AcaInsTiInfoResponse], Error>` + */ + func fetchAcaInsTiListPublisher( + request: AcaInsTiInfoRequest + ) -> AnyPublisher<[AcaInsTiInfoResponse], Error> + + /** + 학교명 등의 검색 조건을 선택하여 반정보를 검색할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - GRADE: (Optional) 학년 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 + - ORD_SC_NM: (Optional) 계열명 + - DDDEP_NM: (Optional) 학과명 + + - Returns: `AnyPublisher<[ClassInfoResponse], Error>` + */ + func fetchClassInfoPublisher( + request: ClassInfoRequest + ) -> AnyPublisher<[ClassInfoResponse], Error> + + /** + 초등학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다 + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - GRADE: (Optional) 학년 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `AnyPublisher<[ElsTimeTableResponse], Error>` + */ + func fetchElsTimeTablePublisher( + request: ElsTimeTableRequest + ) -> AnyPublisher<[ElsTimeTableResponse], Error> + + /** + 고등학교 학년도, 학교, 계열, 학과, 학기, 학년, 강의실, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - GRADE: (Optional) 학년 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `AnyPublisher<[HisTimeTableResponse], Error>` + */ + func fetchHisTimeTablePublisher( + request: HisTimeTableRequest + ) -> AnyPublisher<[HisTimeTableResponse], Error> + + /** + 학교에서 제공하는 현재년도 급식의 요리명, 원산지정보, 칼로리정보, 영양정보 등의 일자별 현황입니다. + + * 요리명에 표시된 번호는 알레르기를 유발할수 있는 식재료입니다 (1.난류, 2.우유, 3.메밀, 4.땅콩, 5.대두, 6.밀, 7.고등어, 8.게, 9.새우, 10.돼지고기, 11.복숭아, 12.토마토, 13.아황산염, 14.호두, 15.닭고기, 16.쇠고기, 17.오징어, 18.조개류(굴,전복,홍합 등)) + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - MMEAL_SC_CODE: (Optional) 식사코드 + - MLSV_YMD: (Optional) 급식일자 + - MLSV_FROM_YMD: (Optional) 급식일자(시작일자) + - MLSV_TO_YMD: (Optional) 급식일자(종료일자) + + - Returns: `AnyPublisher<[MealInfoResponse], Error>` + */ + func fetchMealInfoPublisher( + request: MealInfoRequest + ) -> AnyPublisher<[MealInfoResponse], Error> + + /** + 중학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - GRADE: (Optional) 학년 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `AnyPublisher<[MisTimeTableResponse], Error>` + */ + func fetchMisTimeTablePublisher( + request: MisTimeTableRequest + ) -> AnyPublisher<[MisTimeTableResponse], Error> + + /** + 학교별 학과 정보를 조회할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: (Optional) 표준학교코드 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - ORD_SC_NM: (Optional) 계열명 + + - Returns: `AnyPublisher<[SchoolDepartmentResponse], Error>` + */ + func fetchSchoolDepartmentListPublisher( + request: SchoolDepartmentRequest + ) -> AnyPublisher<[SchoolDepartmentResponse], Error> + + /** + 학교 기본정보에 대한 학교명, 소재지, 주소, 전화번호, 홈페이지주소, 남녀공학여부, 주야구분, 개교기념일 등을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: (Optional) 시도교육청코드 + - SD_SCHUL_CODE: (Optional) 표준학교코드 + - SCHUL_NM: (Optional) 학교명 + - SCHUL_KND_SC_NM: (Optional) 학교 종류명 + - LCTN_SC_NM: (Optional) 소재지명 + - FOND_SC_NM: (Optional) 설립명 + + - Returns: `AnyPublisher<[SchoolInfoResponse], Error>` + */ + func fetchSchoolListPublisher( + request: SchoolInfoRequest + ) -> AnyPublisher<[SchoolInfoResponse], Error> + + /** + 학교명 등의 검색 조건을 선택하여 학교계열정보를 검색할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: (Optional) 표준학교코드 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + + - Returns: `AnyPublisher<[SchulAflcoinfoResponse], Error>` + */ + func fetchSchulAflcoinfoListPublisher( + request: SchulAflcoinfoRequest + ) -> AnyPublisher<[SchulAflcoinfoResponse], Error> + + /** + 특수학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 + - GRADE: (Optional) 학년 + - CLRM_NM: (Optional) 강의실명 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `AnyPublisher<[SpsTimeTableResponse], Error>` + */ + func fetchSpsTimeTable( + request: SpsTimeTableRequest + ) -> AnyPublisher<[SpsTimeTableResponse], Error> + + /** + 학교명 등의 검색 조건을 선택하여 시간표강의실 정보를 검색 할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 번호 + - pSize: 한 페이지 결과 수 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 학교코드 + - AY: (Optional) 학년도 + - GRADE: (Optional) 학년 + - SEM: (Optional) 학기 + - SCHUL_CRSE_SC_NM: (Optional) 학교종류명 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - ORD_SC_NM: (Optional) 계열명 + - DDDEP_NM: (Optional) 학과명 + + - Returns: `AnyPublisher<[TimeTableClassRoomInfoResponse], Error>` + */ + func fetchTimeTableClassRoom( + request: TimeTableClassRoomInfoRequest + ) -> AnyPublisher<[TimeTableClassRoomInfoResponse], Error> +} diff --git a/Sources/CombineNeiSwift/ElsTimeTable/CombineElsTimeTableFetchable+Neis.swift b/Sources/CombineNeiSwift/ElsTimeTable/CombineElsTimeTableFetchable+Neis.swift deleted file mode 100644 index 62e707e..0000000 --- a/Sources/CombineNeiSwift/ElsTimeTable/CombineElsTimeTableFetchable+Neis.swift +++ /dev/null @@ -1,43 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineElsTimeTableFetchable where Self: NeisRequestable { - func fetchElsTimeTablePublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) -> AnyPublisher<[ElsTimeTableResponse], Error> { - Deferred { - Future { fullfill in - self.fetchElsTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - GRADE: GRADE, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD, - completion: fullfill - ) - } - } - .eraseToAnyPublisher() - } -} diff --git a/Sources/CombineNeiSwift/ElsTimeTable/CombineElsTimeTableFetchable+default.swift b/Sources/CombineNeiSwift/ElsTimeTable/CombineElsTimeTableFetchable+default.swift deleted file mode 100644 index d7e5c39..0000000 --- a/Sources/CombineNeiSwift/ElsTimeTable/CombineElsTimeTableFetchable+default.swift +++ /dev/null @@ -1,79 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineElsTimeTableFetchable { - /** - 초등학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다 - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - - Returns: `AnyPublisher<[ElsTimeTableResponse], Error>` - */ - func fetchElsTimeTablePublisher( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String - ) -> AnyPublisher<[ElsTimeTableResponse], Error> { - self.fetchElsTimeTablePublisher( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - SEM: nil, - ALL_TI_YMD: nil, - GRADE: nil, - CLASS_NM: nil, - PERIO: nil, - TI_FROM_YMD: nil, - TI_TO_YMD: nil - ) - } - - func fetchElsTimeTablePublisher( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - SEM: String? = nil, - ALL_TI_YMD: String? = nil, - GRADE: String? = nil, - CLASS_NM: String? = nil, - PERIO: String? = nil, - TI_FROM_YMD: String? = nil, - TI_TO_YMD: String? = nil - ) -> AnyPublisher<[ElsTimeTableResponse], Error> { - self.fetchElsTimeTablePublisher( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - GRADE: GRADE, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD - ) - } -} diff --git a/Sources/CombineNeiSwift/ElsTimeTable/CombineElsTimeTableFetchable.swift b/Sources/CombineNeiSwift/ElsTimeTable/CombineElsTimeTableFetchable.swift deleted file mode 100644 index a487473..0000000 --- a/Sources/CombineNeiSwift/ElsTimeTable/CombineElsTimeTableFetchable.swift +++ /dev/null @@ -1,41 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol CombineElsTimeTableFetchable: ElsTimeTableFetchable { - /** - 초등학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다 - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - - Returns: `AnyPublisher<[ElsTimeTableResponse], Error>` - */ - func fetchElsTimeTablePublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) -> AnyPublisher<[ElsTimeTableResponse], Error> -} diff --git a/Sources/CombineNeiSwift/HisTimeTable/CombineHisTimeTableFetchable+Neis.swift b/Sources/CombineNeiSwift/HisTimeTable/CombineHisTimeTableFetchable+Neis.swift deleted file mode 100644 index 271784b..0000000 --- a/Sources/CombineNeiSwift/HisTimeTable/CombineHisTimeTableFetchable+Neis.swift +++ /dev/null @@ -1,43 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineHisTimeTableFetchable where Self: NeisRequestable { - func fetchHisTimeTablePublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) -> AnyPublisher<[HisTimeTableResponse], Error> { - Deferred { - Future { fullfill in - self.fetchHisTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - GRADE: GRADE, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD, - completion: fullfill - ) - } - } - .eraseToAnyPublisher() - } -} diff --git a/Sources/CombineNeiSwift/HisTimeTable/CombineHisTimeTableFetchable+default.swift b/Sources/CombineNeiSwift/HisTimeTable/CombineHisTimeTableFetchable+default.swift deleted file mode 100644 index 1e9cd0a..0000000 --- a/Sources/CombineNeiSwift/HisTimeTable/CombineHisTimeTableFetchable+default.swift +++ /dev/null @@ -1,79 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineHisTimeTableFetchable { - /** - 고등학교 학년도, 학교, 계열, 학과, 학기, 학년, 강의실, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - - Returns: `AnyPublisher<[HisTimeTableResponse], Error>` - */ - func fetchHisTimeTablePublisher( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String - ) -> AnyPublisher<[HisTimeTableResponse], Error> { - self.fetchHisTimeTablePublisher( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - SEM: nil, - ALL_TI_YMD: nil, - GRADE: nil, - CLASS_NM: nil, - PERIO: nil, - TI_FROM_YMD: nil, - TI_TO_YMD: nil - ) - } - - func fetchHisTimeTablePublisher( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - SEM: String? = nil, - ALL_TI_YMD: String? = nil, - GRADE: String? = nil, - CLASS_NM: String? = nil, - PERIO: String? = nil, - TI_FROM_YMD: String? = nil, - TI_TO_YMD: String? = nil - ) -> AnyPublisher<[HisTimeTableResponse], Error> { - self.fetchHisTimeTablePublisher( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - GRADE: GRADE, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD - ) - } -} diff --git a/Sources/CombineNeiSwift/HisTimeTable/CombineHisTimeTableFetchable.swift b/Sources/CombineNeiSwift/HisTimeTable/CombineHisTimeTableFetchable.swift deleted file mode 100644 index 728ddaf..0000000 --- a/Sources/CombineNeiSwift/HisTimeTable/CombineHisTimeTableFetchable.swift +++ /dev/null @@ -1,41 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol CombineHisTimeTableFetchable: HisTimeTableFetchable { - /** - 고등학교 학년도, 학교, 계열, 학과, 학기, 학년, 강의실, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - - Returns: `AnyPublisher<[HisTimeTableResponse], Error>` - */ - func fetchHisTimeTablePublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) -> AnyPublisher<[HisTimeTableResponse], Error> -} diff --git a/Sources/CombineNeiSwift/MealInfo/CombineMealInfoFetchable+Neis.swift b/Sources/CombineNeiSwift/MealInfo/CombineMealInfoFetchable+Neis.swift deleted file mode 100644 index f37cf6d..0000000 --- a/Sources/CombineNeiSwift/MealInfo/CombineMealInfoFetchable+Neis.swift +++ /dev/null @@ -1,35 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineMealInfoFetchable where Self: NeisRequestable { - func fetchMealInfoPublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - MMEAL_SC_CODE: String?, - MLSV_YMD: String?, - MLSV_FROM_YMD: String?, - MLSV_TO_YMD: String? - ) -> AnyPublisher<[MealInfoResponse], Error> { - Deferred { - Future { fullfill in - self.fetchMealInfo( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - MMEAL_SC_CODE: MMEAL_SC_CODE, - MLSV_YMD: MLSV_YMD, - MLSV_FROM_YMD: MLSV_FROM_YMD, - MLSV_TO_YMD: MLSV_TO_YMD, - completion: fullfill - ) - } - } - .eraseToAnyPublisher() - } -} diff --git a/Sources/CombineNeiSwift/MealInfo/CombineMealInfoFetchable+default.swift b/Sources/CombineNeiSwift/MealInfo/CombineMealInfoFetchable+default.swift deleted file mode 100644 index fbeb868..0000000 --- a/Sources/CombineNeiSwift/MealInfo/CombineMealInfoFetchable+default.swift +++ /dev/null @@ -1,64 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineMealInfoFetchable { - /** - 학교에서 제공하는 현재년도 급식의 요리명, 원산지정보, 칼로리정보, 영양정보 등의 일자별 현황입니다. - - * 요리명에 표시된 번호는 알레르기를 유발할수 있는 식재료입니다 (1.난류, 2.우유, 3.메밀, 4.땅콩, 5.대두, 6.밀, 7.고등어, 8.게, 9.새우, 10.돼지고기, 11.복숭아, 12.토마토, 13.아황산염, 14.호두, 15.닭고기, 16.쇠고기, 17.오징어, 18.조개류(굴,전복,홍합 등) - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - MMEAL_SC_CODE: (Optional) 식사코드 - - MLSV_YMD: (Optional) 급식일자 - - MLSV_FROM_YMD: (Optional) 급식일자(시작일자) - - MLSV_TO_YMD: (Optional) 급식일자(종료일자) - - completion: `Result<[MealInfoResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchMealInfoPublisher( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String - ) -> AnyPublisher<[MealInfoResponse], Error> { - self.fetchMealInfoPublisher( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - MMEAL_SC_CODE: nil, - MLSV_YMD: nil, - MLSV_FROM_YMD: nil, - MLSV_TO_YMD: nil - ) - } - - func fetchMealInfoPublisher( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - MMEAL_SC_CODE: String? = nil, - MLSV_YMD: String? = nil, - MLSV_FROM_YMD: String? = nil, - MLSV_TO_YMD: String? = nil - ) -> AnyPublisher<[MealInfoResponse], Error> { - self.fetchMealInfoPublisher( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - MMEAL_SC_CODE: MMEAL_SC_CODE, - MLSV_YMD: MLSV_YMD, - MLSV_FROM_YMD: MLSV_FROM_YMD, - MLSV_TO_YMD: MLSV_TO_YMD - ) - } -} diff --git a/Sources/CombineNeiSwift/MealInfo/CombineMealInfoFetchable.swift b/Sources/CombineNeiSwift/MealInfo/CombineMealInfoFetchable.swift deleted file mode 100644 index 22616be..0000000 --- a/Sources/CombineNeiSwift/MealInfo/CombineMealInfoFetchable.swift +++ /dev/null @@ -1,35 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol CombineMealInfoFetchable: MealInfoFetchable { - /** - 학교에서 제공하는 현재년도 급식의 요리명, 원산지정보, 칼로리정보, 영양정보 등의 일자별 현황입니다. - - * 요리명에 표시된 번호는 알레르기를 유발할수 있는 식재료입니다 (1.난류, 2.우유, 3.메밀, 4.땅콩, 5.대두, 6.밀, 7.고등어, 8.게, 9.새우, 10.돼지고기, 11.복숭아, 12.토마토, 13.아황산염, 14.호두, 15.닭고기, 16.쇠고기, 17.오징어, 18.조개류(굴,전복,홍합 등) - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - MMEAL_SC_CODE: (Optional) 식사코드 - - MLSV_YMD: (Optional) 급식일자 - - MLSV_FROM_YMD: (Optional) 급식일자(시작일자) - - MLSV_TO_YMD: (Optional) 급식일자(종료일자) - - - Returns: `AnyPublisher<[MealInfoResponse], Error>` - */ - func fetchMealInfoPublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - MMEAL_SC_CODE: String?, - MLSV_YMD: String?, - MLSV_FROM_YMD: String?, - MLSV_TO_YMD: String? - ) -> AnyPublisher<[MealInfoResponse], Error> -} diff --git a/Sources/CombineNeiSwift/MisTimeTable/CombineMisTimeTableFetchable+Neis.swift b/Sources/CombineNeiSwift/MisTimeTable/CombineMisTimeTableFetchable+Neis.swift deleted file mode 100644 index 004eb3c..0000000 --- a/Sources/CombineNeiSwift/MisTimeTable/CombineMisTimeTableFetchable+Neis.swift +++ /dev/null @@ -1,44 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineMisTimeTableFetchable where Self: NeisRequestable { - func fetchMisTimeTablePublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) -> AnyPublisher<[MisTimeTableResponse], Error> { - Deferred { - Future { fullfill in - self.fetchMisTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - GRADE: GRADE, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD, - completion: fullfill - ) - - } - } - .eraseToAnyPublisher() - } -} diff --git a/Sources/CombineNeiSwift/MisTimeTable/CombineMisTimeTableFetchable+default.swift b/Sources/CombineNeiSwift/MisTimeTable/CombineMisTimeTableFetchable+default.swift deleted file mode 100644 index de096be..0000000 --- a/Sources/CombineNeiSwift/MisTimeTable/CombineMisTimeTableFetchable+default.swift +++ /dev/null @@ -1,79 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineMisTimeTableFetchable { - /** - 중학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - - Returns: `AnyPublisher<[MisTimeTableResponse], Error>` - */ - func fetchMisTimeTablePublisher( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String - ) -> AnyPublisher<[MisTimeTableResponse], Error> { - self.fetchMisTimeTablePublisher( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - SEM: nil, - ALL_TI_YMD: nil, - GRADE: nil, - CLASS_NM: nil, - PERIO: nil, - TI_FROM_YMD: nil, - TI_TO_YMD: nil - ) - } - - func fetchMisTimeTablePublisher( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - SEM: String? = nil, - ALL_TI_YMD: String? = nil, - GRADE: String? = nil, - CLASS_NM: String? = nil, - PERIO: String? = nil, - TI_FROM_YMD: String? = nil, - TI_TO_YMD: String? = nil - ) -> AnyPublisher<[MisTimeTableResponse], Error> { - self.fetchMisTimeTablePublisher( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - GRADE: GRADE, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD - ) - } -} diff --git a/Sources/CombineNeiSwift/MisTimeTable/CombineMisTimeTableFetchable.swift b/Sources/CombineNeiSwift/MisTimeTable/CombineMisTimeTableFetchable.swift deleted file mode 100644 index a08eebd..0000000 --- a/Sources/CombineNeiSwift/MisTimeTable/CombineMisTimeTableFetchable.swift +++ /dev/null @@ -1,41 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol CombineMisTimeTableFetchable: MisTimeTableFetchable { - /** - 중학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - - Returns: `AnyPublisher<[MisTimeTableResponse], Error>` - */ - func fetchMisTimeTablePublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) -> AnyPublisher<[MisTimeTableResponse], Error> -} diff --git a/Sources/CombineNeiSwift/Neis+Combine.swift b/Sources/CombineNeiSwift/Neis+Combine.swift new file mode 100644 index 0000000..ff4166a --- /dev/null +++ b/Sources/CombineNeiSwift/Neis+Combine.swift @@ -0,0 +1,325 @@ +import Combine +import NeiSwift + +extension Neis: CombineNeisProtocol {} + +@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) +public extension CombineNeisProtocol where Self: NeisProtocol { + /** + 개설되어있는 학원 및 교습소의 학원명, 휴원일자, 등록상태, 정원, 분야, 계열 및 과정등을 확인할 수 있으며 수강료 공개여부에 따라 수강료 내용을 확인할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - ADMST_ZONE_NM: (Optional) 행정구역명 + - ACA_ASNUM: (Optional) 학원지정번호 + - ACA_NM: (Optional) 학원명 + - REALM_SC_NM: (Optional) 분야명 + - LE_ORD_NM: (Optional) 교습계열명 + - LE_CRSE_NM: (Optional) 교습과정명 + + - Returns: `AnyPublisher<[AcaInsTiInfoResponse], Error>` + */ + func fetchAcaInsTiListPublisher( + request: AcaInsTiInfoRequest + ) -> AnyPublisher<[AcaInsTiInfoResponse], Error> { + Deferred { + Future { fullfill in + self.fetchAcaInsTiList(request: request, completion: fullfill) + } + } + .eraseToAnyPublisher() + } + + /** + 학교명 등의 검색 조건을 선택하여 반정보를 검색할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - GRADE: (Optional) 학년 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 + - ORD_SC_NM: (Optional) 계열명 + - DDDEP_NM: (Optional) 학과명 + + - Returns: `AnyPublisher<[ClassInfoResponse], Error>` + */ + func fetchClassInfoPublisher( + request: ClassInfoRequest + ) -> AnyPublisher<[ClassInfoResponse], Error> { + Deferred { + Future { fullfill in + self.fetchClassInfo(request: request, completion: fullfill) + } + } + .eraseToAnyPublisher() + } + + /** + 초등학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다 + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - GRADE: (Optional) 학년 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `AnyPublisher<[ElsTimeTableResponse], Error>` + */ + func fetchElsTimeTablePublisher( + request: ElsTimeTableRequest + ) -> AnyPublisher<[ElsTimeTableResponse], Error> { + Deferred { + Future { fullfill in + self.fetchElsTimeTable(request: request, completion: fullfill) + } + } + .eraseToAnyPublisher() + } + + /** + 고등학교 학년도, 학교, 계열, 학과, 학기, 학년, 강의실, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - GRADE: (Optional) 학년 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `AnyPublisher<[HisTimeTableResponse], Error>` + */ + func fetchHisTimeTablePublisher( + request: HisTimeTableRequest + ) -> AnyPublisher<[HisTimeTableResponse], Error> { + Deferred { + Future { fullfill in + self.fetchHisTimeTable(request: request, completion: fullfill) + } + } + .eraseToAnyPublisher() + } + + /** + 학교에서 제공하는 현재년도 급식의 요리명, 원산지정보, 칼로리정보, 영양정보 등의 일자별 현황입니다. + + * 요리명에 표시된 번호는 알레르기를 유발할수 있는 식재료입니다 (1.난류, 2.우유, 3.메밀, 4.땅콩, 5.대두, 6.밀, 7.고등어, 8.게, 9.새우, 10.돼지고기, 11.복숭아, 12.토마토, 13.아황산염, 14.호두, 15.닭고기, 16.쇠고기, 17.오징어, 18.조개류(굴,전복,홍합 등)) + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - MMEAL_SC_CODE: (Optional) 식사코드 + - MLSV_YMD: (Optional) 급식일자 + - MLSV_FROM_YMD: (Optional) 급식일자(시작일자) + - MLSV_TO_YMD: (Optional) 급식일자(종료일자) + + - Returns: `AnyPublisher<[MealInfoResponse], Error>` + */ + func fetchMealInfoPublisher( + request: MealInfoRequest + ) -> AnyPublisher<[MealInfoResponse], Error> { + Deferred { + Future { fullfill in + self.fetchMealInfo(request: request, completion: fullfill) + } + } + .eraseToAnyPublisher() + } + + /** + 중학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - GRADE: (Optional) 학년 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `AnyPublisher<[MisTimeTableResponse], Error>` + */ + func fetchMisTimeTablePublisher( + request: MisTimeTableRequest + ) -> AnyPublisher<[MisTimeTableResponse], Error> { + Deferred { + Future { fullfill in + self.fetchMisTimeTable(request: request, completion: fullfill) + } + } + .eraseToAnyPublisher() + } + + /** + 학교별 학과 정보를 조회할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: (Optional) 표준학교코드 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - ORD_SC_NM: (Optional) 계열명 + + - Returns: `AnyPublisher<[SchoolDepartmentResponse], Error>` + */ + func fetchSchoolDepartmentListPublisher( + request: SchoolDepartmentRequest + ) -> AnyPublisher<[SchoolDepartmentResponse], Error> { + Deferred { + Future { fullfill in + self.fetchSchoolDepartmentList(request: request, completion: fullfill) + } + } + .eraseToAnyPublisher() + } + + /** + 학교 기본정보에 대한 학교명, 소재지, 주소, 전화번호, 홈페이지주소, 남녀공학여부, 주야구분, 개교기념일 등을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: (Optional) 시도교육청코드 + - SD_SCHUL_CODE: (Optional) 표준학교코드 + - SCHUL_NM: (Optional) 학교명 + - SCHUL_KND_SC_NM: (Optional) 학교 종류명 + - LCTN_SC_NM: (Optional) 소재지명 + - FOND_SC_NM: (Optional) 설립명 + + - Returns: `AnyPublisher<[SchoolInfoResponse], Error>` + */ + func fetchSchoolListPublisher( + request: SchoolInfoRequest + ) -> AnyPublisher<[SchoolInfoResponse], Error> { + Deferred { + Future { fullfill in + self.fetchSchoolList(request: request, completion: fullfill) + } + } + .eraseToAnyPublisher() + } + + /** + 학교명 등의 검색 조건을 선택하여 학교계열정보를 검색할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: (Optional) 표준학교코드 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + + - Returns: `AnyPublisher<[SchulAflcoinfoResponse], Error>` + */ + func fetchSchulAflcoinfoListPublisher( + request: SchulAflcoinfoRequest + ) -> AnyPublisher<[SchulAflcoinfoResponse], Error> { + Deferred { + Future { fullfill in + self.fetchSchulAflcoinfoList(request: request, completion: fullfill) + } + } + .eraseToAnyPublisher() + } + + /** + 특수학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 + - GRADE: (Optional) 학년 + - CLRM_NM: (Optional) 강의실명 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + + - Returns: `AnyPublisher<[SpsTimeTableResponse], Error>` + */ + func fetchSpsTimeTable( + request: SpsTimeTableRequest + ) -> AnyPublisher<[SpsTimeTableResponse], Error> { + Deferred { + Future { fullfill in + self.fetchSpsTimeTable(request: request, completion: fullfill) + } + } + .eraseToAnyPublisher() + } + + /** + 학교명 등의 검색 조건을 선택하여 시간표강의실 정보를 검색 할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 번호 + - pSize: 한 페이지 결과 수 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 학교코드 + - AY: (Optional) 학년도 + - GRADE: (Optional) 학년 + - SEM: (Optional) 학기 + - SCHUL_CRSE_SC_NM: (Optional) 학교종류명 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - ORD_SC_NM: (Optional) 계열명 + - DDDEP_NM: (Optional) 학과명 + + - Returns: `AnyPublisher<[TimeTableClassRoomInfoResponse], Error>` + */ + func fetchTimeTableClassRoom( + request: TimeTableClassRoomInfoRequest + ) -> AnyPublisher<[TimeTableClassRoomInfoResponse], Error> { + Deferred { + Future { fullfill in + self.fetchTimeTableClassRoom(request: request, completion: fullfill) + } + } + .eraseToAnyPublisher() + } +} diff --git a/Sources/CombineNeiSwift/Neis+CombineAdoption.swift b/Sources/CombineNeiSwift/Neis+CombineAdoption.swift deleted file mode 100644 index 0368185..0000000 --- a/Sources/CombineNeiSwift/Neis+CombineAdoption.swift +++ /dev/null @@ -1,14 +0,0 @@ -import NeiSwift - -extension Neis: - CombineAcaInsTiInfoFetchable, - CombineClassInfoFetchable, - CombineElsTimeTableFetchable, - CombineHisTimeTableFetchable, - CombineMealInfoFetchable, - CombineMisTimeTableFetchable, - CombineSchoolDepartmentFetchable, - CombineSchoolInfoFetchable, - CombineSchulAflcoinfoFetchable, - CombineSpsTimeTableFetchable, - CombineTimeTableClassRoomInfoFetchable {} diff --git a/Sources/CombineNeiSwift/SchoolDepartment/CombineSchoolDepartmentFetchable+Neis.swift b/Sources/CombineNeiSwift/SchoolDepartment/CombineSchoolDepartmentFetchable+Neis.swift deleted file mode 100644 index 457895e..0000000 --- a/Sources/CombineNeiSwift/SchoolDepartment/CombineSchoolDepartmentFetchable+Neis.swift +++ /dev/null @@ -1,31 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineSchoolDepartmentFetchable where Self: NeisRequestable { - func fetchSchoolDepartmentListPublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String?, - DGHT_CRSE_SC_NM: String?, - ORD_SC_NM: String? - ) -> AnyPublisher<[SchoolDepartmentResponse], Error> { - Deferred { - Future { fullfill in - self.fetchSchoolDepartmentList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - ORD_SC_NM: ORD_SC_NM, - completion: fullfill - ) - } - } - .eraseToAnyPublisher() - } -} diff --git a/Sources/CombineNeiSwift/SchoolDepartment/CombineSchoolDepartmentFetchable+default.swift b/Sources/CombineNeiSwift/SchoolDepartment/CombineSchoolDepartmentFetchable+default.swift deleted file mode 100644 index f03c620..0000000 --- a/Sources/CombineNeiSwift/SchoolDepartment/CombineSchoolDepartmentFetchable+default.swift +++ /dev/null @@ -1,54 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineSchoolDepartmentFetchable { - /** - 학교별 학과 정보를 조회할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - ORD_SC_NM: (Optional) 계열명 - - - Returns: `AnyPublisher<[SchoolDepartmentResponse], Error>` - */ - func fetchSchoolDepartmentListPublisher( - key: String, - ATPT_OFCDC_SC_CODE: String - ) -> AnyPublisher<[SchoolDepartmentResponse], Error> { - self.fetchSchoolDepartmentListPublisher( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: nil, - DGHT_CRSE_SC_NM: nil, - ORD_SC_NM: nil - ) - } - - func fetchSchoolDepartmentListPublisher( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String? = nil, - DGHT_CRSE_SC_NM: String? = nil, - ORD_SC_NM: String? = nil - ) -> AnyPublisher<[SchoolDepartmentResponse], Error> { - self.fetchSchoolDepartmentListPublisher( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - ORD_SC_NM: ORD_SC_NM - ) - } -} diff --git a/Sources/CombineNeiSwift/SchoolDepartment/CombineSchoolDepartmentFetchable.swift b/Sources/CombineNeiSwift/SchoolDepartment/CombineSchoolDepartmentFetchable.swift deleted file mode 100644 index 42db695..0000000 --- a/Sources/CombineNeiSwift/SchoolDepartment/CombineSchoolDepartmentFetchable.swift +++ /dev/null @@ -1,29 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol CombineSchoolDepartmentFetchable: SchoolDepartmentFetchable { - /** - 학교별 학과 정보를 조회할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - ORD_SC_NM: (Optional) 계열명 - - - Returns: `AnyPublisher<[SchoolDepartmentResponse], Error>` - */ - func fetchSchoolDepartmentListPublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String?, - DGHT_CRSE_SC_NM: String?, - ORD_SC_NM: String? - ) -> AnyPublisher<[SchoolDepartmentResponse], Error> -} diff --git a/Sources/CombineNeiSwift/SchoolInfo/CombineSchoolInfoFetchable+Neis.swift b/Sources/CombineNeiSwift/SchoolInfo/CombineSchoolInfoFetchable+Neis.swift deleted file mode 100644 index 31c88e3..0000000 --- a/Sources/CombineNeiSwift/SchoolInfo/CombineSchoolInfoFetchable+Neis.swift +++ /dev/null @@ -1,35 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineSchoolInfoFetchable where Self: NeisRequestable { - func fetchSchoolListPublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String?, - SD_SCHUL_CODE: String?, - SCHUL_NM: String?, - SCHUL_KND_SC_NM: String?, - LCTN_SC_NM: String?, - FOND_SC_NM: String? - ) -> AnyPublisher<[SchoolInfoResponse], Error> { - Deferred { - Future { fullfill in - self.fetchSchoolList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - SCHUL_NM: SCHUL_NM, - SCHUL_KND_SC_NM: SCHUL_KND_SC_NM, - LCTN_SC_NM: LCTN_SC_NM, - FOND_SC_NM: FOND_SC_NM, - completion: fullfill - ) - } - } - .eraseToAnyPublisher() - } -} diff --git a/Sources/CombineNeiSwift/SchoolInfo/CombineSchoolInfoFetchable+default.swift b/Sources/CombineNeiSwift/SchoolInfo/CombineSchoolInfoFetchable+default.swift deleted file mode 100644 index d2f8d17..0000000 --- a/Sources/CombineNeiSwift/SchoolInfo/CombineSchoolInfoFetchable+default.swift +++ /dev/null @@ -1,61 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineSchoolInfoFetchable { - /** - 학교 기본정보에 대한 학교명, 소재지, 주소, 전화번호, 홈페이지주소, 남녀공학여부, 주야구분, 개교기념일 등을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: (Optional) 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - SCHUL_NM: (Optional) 학교명 - - SCHUL_KND_SC_NM: (Optional) 학교 종류명 - - LCTN_SC_NM: (Optional) 소재지명 - - FOND_SC_NM: (Optional) 설립명 - - - Returns: `AnyPublisher<[SchoolInfoResponse], Error>` - */ - func fetchSchoolListPublisher( - key: String - ) -> AnyPublisher<[SchoolInfoResponse], Error> { - self.fetchSchoolListPublisher( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: nil, - SD_SCHUL_CODE: nil, - SCHUL_NM: nil, - SCHUL_KND_SC_NM: nil, - LCTN_SC_NM: nil, - FOND_SC_NM: nil - ) - } - - func fetchSchoolListPublisher( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String? = nil, - SD_SCHUL_CODE: String? = nil, - SCHUL_NM: String? = nil, - SCHUL_KND_SC_NM: String? = nil, - LCTN_SC_NM: String? = nil, - FOND_SC_NM: String? = nil - ) -> AnyPublisher<[SchoolInfoResponse], Error> { - self.fetchSchoolListPublisher( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - SCHUL_NM: SCHUL_NM, - SCHUL_KND_SC_NM: SCHUL_KND_SC_NM, - LCTN_SC_NM: LCTN_SC_NM, - FOND_SC_NM: FOND_SC_NM - ) - } -} diff --git a/Sources/CombineNeiSwift/SchoolInfo/CombineSchoolInfoFetchable.swift b/Sources/CombineNeiSwift/SchoolInfo/CombineSchoolInfoFetchable.swift deleted file mode 100644 index 3b05681..0000000 --- a/Sources/CombineNeiSwift/SchoolInfo/CombineSchoolInfoFetchable.swift +++ /dev/null @@ -1,33 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol CombineSchoolInfoFetchable: SchoolInfoFetchable { - /** - 학교 기본정보에 대한 학교명, 소재지, 주소, 전화번호, 홈페이지주소, 남녀공학여부, 주야구분, 개교기념일 등을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: (Optional) 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - SCHUL_NM: (Optional) 학교명 - - SCHUL_KND_SC_NM: (Optional) 학교 종류명 - - LCTN_SC_NM: (Optional) 소재지명 - - FOND_SC_NM: (Optional) 설립명 - - - Returns: `AnyPublisher<[SchoolInfoResponse], Error>` - */ - func fetchSchoolListPublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String?, - SD_SCHUL_CODE: String?, - SCHUL_NM: String?, - SCHUL_KND_SC_NM: String?, - LCTN_SC_NM: String?, - FOND_SC_NM: String? - ) -> AnyPublisher<[SchoolInfoResponse], Error> -} diff --git a/Sources/CombineNeiSwift/SchulAflcoinfo/CombineSchulAflcoinfoFetchable+Neis.swift b/Sources/CombineNeiSwift/SchulAflcoinfo/CombineSchulAflcoinfoFetchable+Neis.swift deleted file mode 100644 index 6729ed7..0000000 --- a/Sources/CombineNeiSwift/SchulAflcoinfo/CombineSchulAflcoinfoFetchable+Neis.swift +++ /dev/null @@ -1,29 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineSchulAflcoinfoFetchable where Self: NeisRequestable { - func fetchSchulAflcoinfoListPublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String?, - DGHT_CRSE_SC_NM: String? - ) -> AnyPublisher<[SchulAflcoinfoResponse], Error> { - Deferred { - Future { fullfill in - self.fetchSchulAflcoinfoList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - completion: fullfill - ) - } - } - .eraseToAnyPublisher() - } -} diff --git a/Sources/CombineNeiSwift/SchulAflcoinfo/CombineSchulAflcoinfoFetchable+default.swift b/Sources/CombineNeiSwift/SchulAflcoinfo/CombineSchulAflcoinfoFetchable+default.swift deleted file mode 100644 index db9149e..0000000 --- a/Sources/CombineNeiSwift/SchulAflcoinfo/CombineSchulAflcoinfoFetchable+default.swift +++ /dev/null @@ -1,50 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineSchulAflcoinfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 학교계열정보를 검색할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - - Returns: `AnyPublisher<[SchulAflcoinfoResponse], Error>` - */ - func fetchSchulAflcoinfoListPublisher( - key: String, - ATPT_OFCDC_SC_CODE: String - ) -> AnyPublisher<[SchulAflcoinfoResponse], Error> { - self.fetchSchulAflcoinfoListPublisher( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: nil, - DGHT_CRSE_SC_NM: nil - ) - } - - func fetchSchulAflcoinfoListPublisher( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String? = nil, - DGHT_CRSE_SC_NM: String? = nil - ) -> AnyPublisher<[SchulAflcoinfoResponse], Error> { - self.fetchSchulAflcoinfoListPublisher( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM - ) - } -} diff --git a/Sources/CombineNeiSwift/SchulAflcoinfo/CombineSchulAflcoinfoFetchable.swift b/Sources/CombineNeiSwift/SchulAflcoinfo/CombineSchulAflcoinfoFetchable.swift deleted file mode 100644 index fb9bcde..0000000 --- a/Sources/CombineNeiSwift/SchulAflcoinfo/CombineSchulAflcoinfoFetchable.swift +++ /dev/null @@ -1,27 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol CombineSchulAflcoinfoFetchable: SchulAflcoinfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 학교계열정보를 검색할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - - Returns: `AnyPublisher<[SchulAflcoinfoResponse], Error>` - */ - func fetchSchulAflcoinfoListPublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String?, - DGHT_CRSE_SC_NM: String? - ) -> AnyPublisher<[SchulAflcoinfoResponse], Error> -} diff --git a/Sources/CombineNeiSwift/SpsTimeTable/CombineSpsTimeTableFetchable+Neis.swift b/Sources/CombineNeiSwift/SpsTimeTable/CombineSpsTimeTableFetchable+Neis.swift deleted file mode 100644 index 59c0747..0000000 --- a/Sources/CombineNeiSwift/SpsTimeTable/CombineSpsTimeTableFetchable+Neis.swift +++ /dev/null @@ -1,47 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineSpsTimeTableFetchable where Self: NeisRequestable { - func fetchSpsTimeTablePublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - SCHUL_CRSE_SC_NM: String?, - GRADE: String?, - CLRM_NM: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) -> AnyPublisher<[SpsTimeTableResponse], Error> { - Deferred { - Future { fullfill in - self.fetchSpsTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - SCHUL_CRSE_SC_NM: SCHUL_CRSE_SC_NM, - GRADE: GRADE, - CLRM_NM: CLRM_NM, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD, - completion: fullfill - ) - } - } - .eraseToAnyPublisher() - } -} diff --git a/Sources/CombineNeiSwift/SpsTimeTable/CombineSpsTimeTableFetchable+default.swift b/Sources/CombineNeiSwift/SpsTimeTable/CombineSpsTimeTableFetchable+default.swift deleted file mode 100644 index ce77a33..0000000 --- a/Sources/CombineNeiSwift/SpsTimeTable/CombineSpsTimeTableFetchable+default.swift +++ /dev/null @@ -1,87 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineSpsTimeTableFetchable { - /** - 특수학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 - - GRADE: (Optional) 학년 - - CLRM_NM: (Optional) 강의실명 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - - Returns: `AnyPublisher<[SpsTimeTableResponse], Error>` - */ - func fetchSpsTimeTablePublisher( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String - ) -> AnyPublisher<[SpsTimeTableResponse], Error> { - self.fetchSpsTimeTablePublisher( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - SEM: nil, - ALL_TI_YMD: nil, - SCHUL_CRSE_SC_NM: nil, - GRADE: nil, - CLRM_NM: nil, - CLASS_NM: nil, - PERIO: nil, - TI_FROM_YMD: nil, - TI_TO_YMD: nil - ) - } - - func fetchSpsTimeTablePublisher( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - SEM: String? = nil, - ALL_TI_YMD: String? = nil, - SCHUL_CRSE_SC_NM: String? = nil, - GRADE: String? = nil, - CLRM_NM: String? = nil, - CLASS_NM: String? = nil, - PERIO: String? = nil, - TI_FROM_YMD: String? = nil, - TI_TO_YMD: String? = nil - ) -> AnyPublisher<[SpsTimeTableResponse], Error> { - self.fetchSpsTimeTablePublisher( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - SCHUL_CRSE_SC_NM: SCHUL_CRSE_SC_NM, - GRADE: GRADE, - CLRM_NM: CLRM_NM, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD - ) - } -} diff --git a/Sources/CombineNeiSwift/SpsTimeTable/CombineSpsTimeTableFetchable.swift b/Sources/CombineNeiSwift/SpsTimeTable/CombineSpsTimeTableFetchable.swift deleted file mode 100644 index 61d01f1..0000000 --- a/Sources/CombineNeiSwift/SpsTimeTable/CombineSpsTimeTableFetchable.swift +++ /dev/null @@ -1,45 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol CombineSpsTimeTableFetchable: SpsTimeTableFetchable { - /** - 특수학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 - - GRADE: (Optional) 학년 - - CLRM_NM: (Optional) 강의실명 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - - Returns: `AnyPublisher<[SpsTimeTableResponse], Error>` - */ - func fetchSpsTimeTablePublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - SCHUL_CRSE_SC_NM: String?, - GRADE: String?, - CLRM_NM: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String? - ) -> AnyPublisher<[SpsTimeTableResponse], Error> -} diff --git a/Sources/CombineNeiSwift/TimeTableClassRoomInfo/CombineTimeTableClassRoomInfoFetchable+Neis.swift b/Sources/CombineNeiSwift/TimeTableClassRoomInfo/CombineTimeTableClassRoomInfoFetchable+Neis.swift deleted file mode 100644 index 6b2b775..0000000 --- a/Sources/CombineNeiSwift/TimeTableClassRoomInfo/CombineTimeTableClassRoomInfoFetchable+Neis.swift +++ /dev/null @@ -1,41 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineTimeTableClassRoomInfoFetchable where Self: NeisRequestable { - func fetchTimeTableClassRoomPublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - GRADE: String?, - SEM: String?, - SCHUL_CRSE_SC_NM: String?, - DGHT_CRSE_SC_NM: String?, - ORD_SC_NM: String?, - DDDEP_NM: String? - ) -> AnyPublisher<[TimeTableClassRoomInfoResponse], Error> { - Deferred { - Future { fullfill in - self.fetchTimeTableClassRoom( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - GRADE: GRADE, - SEM: SEM, - SCHUL_CRSE_SC_NM: SCHUL_CRSE_SC_NM, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - ORD_SC_NM: ORD_SC_NM, - DDDEP_NM: DDDEP_NM, - completion: fullfill - ) - } - } - .eraseToAnyPublisher() - } -} diff --git a/Sources/CombineNeiSwift/TimeTableClassRoomInfo/CombineTimeTableClassRoomInfoFetchable+default.swift b/Sources/CombineNeiSwift/TimeTableClassRoomInfo/CombineTimeTableClassRoomInfoFetchable+default.swift deleted file mode 100644 index 0c02ac9..0000000 --- a/Sources/CombineNeiSwift/TimeTableClassRoomInfo/CombineTimeTableClassRoomInfoFetchable+default.swift +++ /dev/null @@ -1,75 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public extension CombineTimeTableClassRoomInfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 시간표강의실 정보를 검색 할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 번호 - - pSize: 한 페이지 결과 수 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 학교코드 - - AY: (Optional) 학년도 - - GRADE: (Optional) 학년 - - SEM: (Optional) 학기 - - SCHUL_CRSE_SC_NM: (Optional) 학교종류명 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - ORD_SC_NM: (Optional) 계열명 - - DDDEP_NM: (Optional) 학과명 - - - Returns: `AnyPublisher<[TimeTableClassRoomInfoResponse], Error>` - */ - func fetchTimeTableClassRoomPublisher( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String - ) -> AnyPublisher<[TimeTableClassRoomInfoResponse], Error> { - self.fetchTimeTableClassRoomPublisher( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - GRADE: nil, - SEM: nil, - SCHUL_CRSE_SC_NM: nil, - DGHT_CRSE_SC_NM: nil, - ORD_SC_NM: nil, - DDDEP_NM: nil - ) - } - - func fetchTimeTableClassRoomPublisher( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - GRADE: String? = nil, - SEM: String? = nil, - SCHUL_CRSE_SC_NM: String? = nil, - DGHT_CRSE_SC_NM: String? = nil, - ORD_SC_NM: String? = nil, - DDDEP_NM: String? = nil - ) -> AnyPublisher<[TimeTableClassRoomInfoResponse], Error> { - self.fetchTimeTableClassRoomPublisher( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - GRADE: GRADE, - SEM: SEM, - SCHUL_CRSE_SC_NM: SCHUL_CRSE_SC_NM, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - ORD_SC_NM: ORD_SC_NM, - DDDEP_NM: DDDEP_NM - ) - } -} diff --git a/Sources/CombineNeiSwift/TimeTableClassRoomInfo/CombineTimeTableClassRoomInfoFetchable.swift b/Sources/CombineNeiSwift/TimeTableClassRoomInfo/CombineTimeTableClassRoomInfoFetchable.swift deleted file mode 100644 index 7a6206b..0000000 --- a/Sources/CombineNeiSwift/TimeTableClassRoomInfo/CombineTimeTableClassRoomInfoFetchable.swift +++ /dev/null @@ -1,39 +0,0 @@ -import Combine -import NeiSwift - -@available(iOS 13.0, tvOS 13.0, macOS 10.5, watchOS 6.0, *) -public protocol CombineTimeTableClassRoomInfoFetchable: TimeTableClassRoomInfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 시간표강의실 정보를 검색 할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 번호 - - pSize: 한 페이지 결과 수 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 학교코드 - - AY: (Optional) 학년도 - - GRADE: (Optional) 학년 - - SEM: (Optional) 학기 - - SCHUL_CRSE_SC_NM: (Optional) 학교종류명 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - ORD_SC_NM: (Optional) 계열명 - - DDDEP_NM: (Optional) 학과명 - - - Returns: `AnyPublisher<[TimeTableClassRoomInfoResponse], Error>` - */ - func fetchTimeTableClassRoomPublisher( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - GRADE: String?, - SEM: String?, - SCHUL_CRSE_SC_NM: String?, - DGHT_CRSE_SC_NM: String?, - ORD_SC_NM: String?, - DDDEP_NM: String? - ) -> AnyPublisher<[TimeTableClassRoomInfoResponse], Error> -} diff --git a/Sources/NeiSwift/Protocol/DictionaryConvertable.swift b/Sources/NeiSwift/Protocol/DictionaryConvertable.swift new file mode 100644 index 0000000..b6b8a1d --- /dev/null +++ b/Sources/NeiSwift/Protocol/DictionaryConvertable.swift @@ -0,0 +1,18 @@ +import Foundation + +public protocol DictionaryConvertable { + func toDictionary() -> [String: Any] +} + +extension DictionaryConvertable { + public func toDictionary() -> [String: Any] { + let mirror = Mirror(reflecting: self) + let mirrorMap: [(String, Any)] = mirror.children + .compactMap { + guard let key = $0.label else { return nil } + return (key, $0.value) + } + let dict = Dictionary(uniqueKeysWithValues: mirrorMap) + return dict + } +} diff --git a/Sources/NeiSwift/Protocol/NeisRequestable.swift b/Sources/NeiSwift/Protocol/NeisRequestable.swift index ac388ab..bb5b8c9 100644 --- a/Sources/NeiSwift/Protocol/NeisRequestable.swift +++ b/Sources/NeiSwift/Protocol/NeisRequestable.swift @@ -8,18 +8,17 @@ public protocol NeisRequestable { ) } -public extension NeisRequestable where Self: HasURLSession, Self: HasNeisParser { +public extension NeisRequestable where Self: HasURLSession, Self: HasNeisParser, Self: NeisURLBuildable { func neisRequest( key: String, parameters: [URLQueryItem], completion: @escaping (Result) -> Void ) { - var urlComponents = URLComponents(string: "\(NeisConstants.baseNeisURL)/\(key)") - urlComponents?.queryItems = parameters - guard - let requestURL = urlComponents?.url - else { - completion(.failure(NeisError.invalidNeisURL)) + let requestURL: URL + do { + requestURL = try self.buildNeisURL(field: key, parameters: parameters) + } catch { + completion(.failure(error)) return } diff --git a/Sources/NeiSwift/Protocol/NeisURLBuildable.swift b/Sources/NeiSwift/Protocol/NeisURLBuildable.swift new file mode 100644 index 0000000..4b8f274 --- /dev/null +++ b/Sources/NeiSwift/Protocol/NeisURLBuildable.swift @@ -0,0 +1,18 @@ +import Foundation + +public protocol NeisURLBuildable { + func buildNeisURL(field: String, parameters: [URLQueryItem]) throws -> URL +} + +extension NeisURLBuildable { + public func buildNeisURL(field: String, parameters: [URLQueryItem]) throws -> URL { + var urlComponents = URLComponents(string: "https://open.neis.go.kr/hub/\(field)") + urlComponents?.queryItems = parameters + guard + let requestURL = urlComponents?.url + else { + throw NeisError.invalidNeisURL + } + return requestURL + } +} diff --git a/Sources/NeiSwift/Public/AcaInsTiInfo/AcaInsTiInfoFetchable+Neis.swift b/Sources/NeiSwift/Public/AcaInsTiInfo/AcaInsTiInfoFetchable+Neis.swift deleted file mode 100644 index e249871..0000000 --- a/Sources/NeiSwift/Public/AcaInsTiInfo/AcaInsTiInfoFetchable+Neis.swift +++ /dev/null @@ -1,39 +0,0 @@ -import Combine -import Foundation - -public extension AcaInsTiInfoFetchable where Self: NeisRequestable { - func fetchAcaInsTiList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - ADMST_ZONE_NM: String?, - ACA_ASNUM: String?, - ACA_NM: String?, - REALM_SC_NM: String?, - LE_ORD_NM: String?, - LE_CRSE_NM: String?, - completion: @escaping (Result<[AcaInsTiInfoResponse], Error>) -> Void - ) { - let parameters: [URLQueryItem] = [ - "KEY": key, - "Type": "json", - "pIndex": "\(pIndex)", - "pSize": "\(pSize)", - "ATPT_OFCDC_SC_CODE": ATPT_OFCDC_SC_CODE, - "ADMST_ZONE_NM": ADMST_ZONE_NM, - "ACA_ASNUM": ACA_ASNUM, - "ACA_NM": ACA_NM, - "REALM_SC_NM": REALM_SC_NM, - "LE_ORD_NM": LE_ORD_NM, - "LE_CRSE_NM": LE_CRSE_NM - ] - .reduce(into: [URLQueryItem]()) { partialResult, dict in - guard let value = dict.value else { return } - let item = URLQueryItem(name: dict.key, value: value) - partialResult.append(item) - } - - neisRequest(key: "acaInsTiInfo", parameters: parameters, completion: completion) - } -} diff --git a/Sources/NeiSwift/Public/AcaInsTiInfo/AcaInsTiInfoFetchable+default.swift b/Sources/NeiSwift/Public/AcaInsTiInfo/AcaInsTiInfoFetchable+default.swift deleted file mode 100644 index beac174..0000000 --- a/Sources/NeiSwift/Public/AcaInsTiInfo/AcaInsTiInfoFetchable+default.swift +++ /dev/null @@ -1,68 +0,0 @@ -import Combine -import Foundation - -public extension AcaInsTiInfoFetchable { - /** - 개설되어있는 학원 및 교습소의 학원명, 휴원일자, 등록상태, 정원, 분야, 계열 및 과정등을 확인할 수 있으며 수강료 공개여부에 따라 수강료 내용을 확인할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - ADMST_ZONE_NM: (Optional) 행정구역명 - - ACA_ASNUM: (Optional) 학원지정번호 - - ACA_NM: (Optional) 학원명 - - REALM_SC_NM: (Optional) 분야명 - - LE_ORD_NM: (Optional) 교습계열명 - - LE_CRSE_NM: (Optional) 교습과정명 - - completion: `Result<[AcaInsTiInfoResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchAcaInsTiList( - key: String, - ATPT_OFCDC_SC_CODE: String, - completion: @escaping (Result<[AcaInsTiInfoResponse], Error>) -> Void - ) { - self.fetchAcaInsTiList( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - ADMST_ZONE_NM: nil, - ACA_ASNUM: nil, - ACA_NM: nil, - REALM_SC_NM: nil, - LE_ORD_NM: nil, - LE_CRSE_NM: nil, - completion: completion - ) - } - - func fetchAcaInsTiList( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - ADMST_ZONE_NM: String? = nil, - ACA_ASNUM: String? = nil, - ACA_NM: String? = nil, - REALM_SC_NM: String? = nil, - LE_ORD_NM: String? = nil, - LE_CRSE_NM: String? = nil, - completion: @escaping (Result<[AcaInsTiInfoResponse], Error>) -> Void - ) { - self.fetchAcaInsTiList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - ADMST_ZONE_NM: ADMST_ZONE_NM, - ACA_ASNUM: ACA_ASNUM, - ACA_NM: ACA_NM, - REALM_SC_NM: REALM_SC_NM, - LE_ORD_NM: LE_ORD_NM, - LE_CRSE_NM: LE_CRSE_NM, - completion: completion - ) - } -} diff --git a/Sources/NeiSwift/Public/AcaInsTiInfo/AcaInsTiInfoFetchable.swift b/Sources/NeiSwift/Public/AcaInsTiInfo/AcaInsTiInfoFetchable.swift deleted file mode 100644 index a69c783..0000000 --- a/Sources/NeiSwift/Public/AcaInsTiInfo/AcaInsTiInfoFetchable.swift +++ /dev/null @@ -1,34 +0,0 @@ -import Combine -import Foundation - -public protocol AcaInsTiInfoFetchable { - /** - 개설되어있는 학원 및 교습소의 학원명, 휴원일자, 등록상태, 정원, 분야, 계열 및 과정등을 확인할 수 있으며 수강료 공개여부에 따라 수강료 내용을 확인할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - ADMST_ZONE_NM: (Optional) 행정구역명 - - ACA_ASNUM: (Optional) 학원지정번호 - - ACA_NM: (Optional) 학원명 - - REALM_SC_NM: (Optional) 분야명 - - LE_ORD_NM: (Optional) 교습계열명 - - LE_CRSE_NM: (Optional) 교습과정명 - - completion: `Result<[AcaInsTiInfoResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchAcaInsTiList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - ADMST_ZONE_NM: String?, - ACA_ASNUM: String?, - ACA_NM: String?, - REALM_SC_NM: String?, - LE_ORD_NM: String?, - LE_CRSE_NM: String?, - completion: @escaping (Result<[AcaInsTiInfoResponse], Error>) -> Void - ) -} diff --git a/Sources/NeiSwift/Public/ClassInfo/ClassInfoFetchable+Neis.swift b/Sources/NeiSwift/Public/ClassInfo/ClassInfoFetchable+Neis.swift deleted file mode 100644 index 71da823..0000000 --- a/Sources/NeiSwift/Public/ClassInfo/ClassInfoFetchable+Neis.swift +++ /dev/null @@ -1,41 +0,0 @@ -import Combine -import Foundation - -public extension ClassInfoFetchable where Self: NeisRequestable { - func fetchClassInfo( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - GRADE: String?, - DGHT_CRSE_SC_NM: String?, - SCHUL_CRSE_SC_NM: String?, - ORD_SC_NM: String?, - DDDEP_NM: String?, - completion: @escaping (Result<[ClassInfoResponse], Error>) -> Void - ) { - let parameters: [URLQueryItem] = [ - "KEY": key, - "Type": "json", - "pIndex": "\(pIndex)", - "pSize": "\(pSize)", - "ATPT_OFCDC_SC_CODE": ATPT_OFCDC_SC_CODE, - "SD_SCHUL_CODE": SD_SCHUL_CODE, - "AY": AY, - "GRADE": GRADE, - "DGHT_CRSE_SC_NM": DGHT_CRSE_SC_NM, - "SCHUL_CRSE_SC_NM": SCHUL_CRSE_SC_NM, - "ORD_SC_NM": ORD_SC_NM, - "DDDEP_NM": DDDEP_NM - ] - .reduce(into: [URLQueryItem]()) { partialResult, dict in - guard let value = dict.value else { return } - let item = URLQueryItem(name: dict.key, value: value) - partialResult.append(item) - } - - neisRequest(key: "classInfo", parameters: parameters, completion: completion) - } -} diff --git a/Sources/NeiSwift/Public/ClassInfo/ClassInfoFetchable+default.swift b/Sources/NeiSwift/Public/ClassInfo/ClassInfoFetchable+default.swift deleted file mode 100644 index 905fb43..0000000 --- a/Sources/NeiSwift/Public/ClassInfo/ClassInfoFetchable+default.swift +++ /dev/null @@ -1,73 +0,0 @@ -import Combine -import Foundation - -public extension ClassInfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 반정보를 검색할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - GRADE: (Optional) 학년 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 - - ORD_SC_NM: (Optional) 계열명 - - DDDEP_NM: (Optional) 학과명 - - completion: `Result<[ClassInfoResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchClassInfo( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - completion: @escaping (Result<[ClassInfoResponse], Error>) -> Void - ) { - self.fetchClassInfo( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - GRADE: nil, - DGHT_CRSE_SC_NM: nil, - SCHUL_CRSE_SC_NM: nil, - ORD_SC_NM: nil, - DDDEP_NM: nil, - completion: completion - ) - } - - func fetchClassInfo( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - GRADE: String? = nil, - DGHT_CRSE_SC_NM: String? = nil, - SCHUL_CRSE_SC_NM: String? = nil, - ORD_SC_NM: String? = nil, - DDDEP_NM: String? = nil, - completion: @escaping (Result<[ClassInfoResponse], Error>) -> Void - ) { - self.fetchClassInfo( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - GRADE: GRADE, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - SCHUL_CRSE_SC_NM: SCHUL_CRSE_SC_NM, - ORD_SC_NM: ORD_SC_NM, - DDDEP_NM: DDDEP_NM, - completion: completion - ) - } -} diff --git a/Sources/NeiSwift/Public/ClassInfo/ClassInfoFetchable.swift b/Sources/NeiSwift/Public/ClassInfo/ClassInfoFetchable.swift deleted file mode 100644 index 1a2cbd0..0000000 --- a/Sources/NeiSwift/Public/ClassInfo/ClassInfoFetchable.swift +++ /dev/null @@ -1,36 +0,0 @@ -import Combine -import Foundation - -public protocol ClassInfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 반정보를 검색할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - GRADE: (Optional) 학년 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 - - ORD_SC_NM: (Optional) 계열명 - - DDDEP_NM: (Optional) 학과명 - - completion: `Result<[ClassInfoResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchClassInfo( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - GRADE: String?, - DGHT_CRSE_SC_NM: String?, - SCHUL_CRSE_SC_NM: String?, - ORD_SC_NM: String?, - DDDEP_NM: String?, - completion: @escaping (Result<[ClassInfoResponse], Error>) -> Void - ) -} diff --git a/Sources/NeiSwift/Public/ElsTimeTable/ElsTimeTableFetchable+Neis.swift b/Sources/NeiSwift/Public/ElsTimeTable/ElsTimeTableFetchable+Neis.swift deleted file mode 100644 index 47af90a..0000000 --- a/Sources/NeiSwift/Public/ElsTimeTable/ElsTimeTableFetchable+Neis.swift +++ /dev/null @@ -1,45 +0,0 @@ -import Combine -import Foundation - -public extension ElsTimeTableFetchable where Self: NeisRequestable { - func fetchElsTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String?, - completion: @escaping (Result<[ElsTimeTableResponse], Error>) -> Void - ) { - let parameters: [URLQueryItem] = [ - "KEY": key, - "Type": "json", - "pIndex": "\(pIndex)", - "pSize": "\(pSize)", - "ATPT_OFCDC_SC_CODE": ATPT_OFCDC_SC_CODE, - "SD_SCHUL_CODE": SD_SCHUL_CODE, - "AY": AY, - "SEM": SEM, - "ALL_TI_YMD": ALL_TI_YMD, - "GRADE": GRADE, - "CLASS_NM": CLASS_NM, - "PERIO": PERIO, - "TI_FROM_YMD": TI_FROM_YMD, - "TI_TO_YMD": TI_TO_YMD - ] - .reduce(into: [URLQueryItem]()) { partialResult, dict in - guard let value = dict.value else { return } - let item = URLQueryItem(name: dict.key, value: value) - partialResult.append(item) - } - - neisRequest(key: "elsTimetable", parameters: parameters, completion: completion) - } -} diff --git a/Sources/NeiSwift/Public/ElsTimeTable/ElsTimeTableFetchable+default.swift b/Sources/NeiSwift/Public/ElsTimeTable/ElsTimeTableFetchable+default.swift deleted file mode 100644 index d9cf211..0000000 --- a/Sources/NeiSwift/Public/ElsTimeTable/ElsTimeTableFetchable+default.swift +++ /dev/null @@ -1,81 +0,0 @@ -import Combine -import Foundation - -public extension ElsTimeTableFetchable { - /** - 초등학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다 - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - completion: `Result<[ElsTimeTableResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchElsTimeTable( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - completion: @escaping (Result<[ElsTimeTableResponse], Error>) -> Void - ) { - self.fetchElsTimeTable( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - SEM: nil, - ALL_TI_YMD: nil, - GRADE: nil, - CLASS_NM: nil, - PERIO: nil, - TI_FROM_YMD: nil, - TI_TO_YMD: nil, - completion: completion - ) - } - - func fetchElsTimeTable( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - SEM: String? = nil, - ALL_TI_YMD: String? = nil, - GRADE: String? = nil, - CLASS_NM: String? = nil, - PERIO: String? = nil, - TI_FROM_YMD: String? = nil, - TI_TO_YMD: String? = nil, - completion: @escaping (Result<[ElsTimeTableResponse], Error>) -> Void - ) { - self.fetchElsTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - GRADE: GRADE, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD, - completion: completion - ) - } -} diff --git a/Sources/NeiSwift/Public/ElsTimeTable/ElsTimeTableFetchable.swift b/Sources/NeiSwift/Public/ElsTimeTable/ElsTimeTableFetchable.swift deleted file mode 100644 index a04976e..0000000 --- a/Sources/NeiSwift/Public/ElsTimeTable/ElsTimeTableFetchable.swift +++ /dev/null @@ -1,40 +0,0 @@ -import Combine -import Foundation - -public protocol ElsTimeTableFetchable { - /** - 초등학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다 - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - completion: `Result<[ElsTimeTableResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchElsTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String?, - completion: @escaping (Result<[ElsTimeTableResponse], Error>) -> Void - ) -} diff --git a/Sources/NeiSwift/Public/HisTimeTable/HisTimeTableFetchable+Neis.swift b/Sources/NeiSwift/Public/HisTimeTable/HisTimeTableFetchable+Neis.swift deleted file mode 100644 index 2e30e43..0000000 --- a/Sources/NeiSwift/Public/HisTimeTable/HisTimeTableFetchable+Neis.swift +++ /dev/null @@ -1,45 +0,0 @@ -import Combine -import Foundation - -public extension HisTimeTableFetchable where Self: NeisRequestable { - func fetchHisTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String?, - completion: @escaping (Result<[HisTimeTableResponse], Error>) -> Void - ) { - let parameters: [URLQueryItem] = [ - "KEY": key, - "Type": "json", - "pIndex": "\(pIndex)", - "pSize": "\(pSize)", - "ATPT_OFCDC_SC_CODE": ATPT_OFCDC_SC_CODE, - "SD_SCHUL_CODE": SD_SCHUL_CODE, - "AY": AY, - "SEM": SEM, - "ALL_TI_YMD": ALL_TI_YMD, - "GRADE": GRADE, - "CLASS_NM": CLASS_NM, - "PERIO": PERIO, - "TI_FROM_YMD": TI_FROM_YMD, - "TI_TO_YMD": TI_TO_YMD - ] - .reduce(into: [URLQueryItem]()) { partialResult, dict in - guard let value = dict.value else { return } - let item = URLQueryItem(name: dict.key, value: value) - partialResult.append(item) - } - - neisRequest(key: "hisTimetable", parameters: parameters, completion: completion) - } -} diff --git a/Sources/NeiSwift/Public/HisTimeTable/HisTimeTableFetchable+default.swift b/Sources/NeiSwift/Public/HisTimeTable/HisTimeTableFetchable+default.swift deleted file mode 100644 index e49eaf9..0000000 --- a/Sources/NeiSwift/Public/HisTimeTable/HisTimeTableFetchable+default.swift +++ /dev/null @@ -1,81 +0,0 @@ -import Combine -import Foundation - -public extension HisTimeTableFetchable { - /** - 고등학교 학년도, 학교, 계열, 학과, 학기, 학년, 강의실, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - completion: `Result<[HisTimeTableResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchHisTimeTable( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - completion: @escaping (Result<[HisTimeTableResponse], Error>) -> Void - ) { - self.fetchHisTimeTable( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - SEM: nil, - ALL_TI_YMD: nil, - GRADE: nil, - CLASS_NM: nil, - PERIO: nil, - TI_FROM_YMD: nil, - TI_TO_YMD: nil, - completion: completion - ) - } - - func fetchHisTimeTable( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - SEM: String? = nil, - ALL_TI_YMD: String? = nil, - GRADE: String? = nil, - CLASS_NM: String? = nil, - PERIO: String? = nil, - TI_FROM_YMD: String? = nil, - TI_TO_YMD: String? = nil, - completion: @escaping (Result<[HisTimeTableResponse], Error>) -> Void - ) { - self.fetchHisTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - GRADE: GRADE, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD, - completion: completion - ) - } -} diff --git a/Sources/NeiSwift/Public/HisTimeTable/HisTimeTableFetchable.swift b/Sources/NeiSwift/Public/HisTimeTable/HisTimeTableFetchable.swift deleted file mode 100644 index 58076b5..0000000 --- a/Sources/NeiSwift/Public/HisTimeTable/HisTimeTableFetchable.swift +++ /dev/null @@ -1,40 +0,0 @@ -import Combine -import Foundation - -public protocol HisTimeTableFetchable { - /** - 고등학교 학년도, 학교, 계열, 학과, 학기, 학년, 강의실, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - completion: `Result<[HisTimeTableResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchHisTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String?, - completion: @escaping (Result<[HisTimeTableResponse], Error>) -> Void - ) -} diff --git a/Sources/NeiSwift/Public/MealInfo/MealInfoFetchable+Neis.swift b/Sources/NeiSwift/Public/MealInfo/MealInfoFetchable+Neis.swift deleted file mode 100644 index c3c0f84..0000000 --- a/Sources/NeiSwift/Public/MealInfo/MealInfoFetchable+Neis.swift +++ /dev/null @@ -1,38 +0,0 @@ -import Combine -import Foundation - -public extension MealInfoFetchable where Self: NeisRequestable { - func fetchMealInfo( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - MMEAL_SC_CODE: String?, - MLSV_YMD: String?, - MLSV_FROM_YMD: String?, - MLSV_TO_YMD: String?, - completion: @escaping (Result<[MealInfoResponse - ], Error>) -> Void - ) { - let parameters: [URLQueryItem] = [ - "KEY": key, - "Type": "json", - "pIndex": "\(pIndex)", - "pSize": "\(pSize)", - "ATPT_OFCDC_SC_CODE": ATPT_OFCDC_SC_CODE, - "SD_SCHUL_CODE": SD_SCHUL_CODE, - "MMEAL_SC_CODE": MMEAL_SC_CODE, - "MLSV_YMD": MLSV_YMD, - "MLSV_FROM_YMD": MLSV_FROM_YMD, - "MLSV_TO_YMD": MLSV_TO_YMD - ] - .reduce(into: [URLQueryItem]()) { partialResult, dict in - guard let value = dict.value else { return } - let item = URLQueryItem(name: dict.key, value: value) - partialResult.append(item) - } - - neisRequest(key: "mealServiceDietInfo", parameters: parameters, completion: completion) - } -} diff --git a/Sources/NeiSwift/Public/MealInfo/MealInfoFetchable+default.swift b/Sources/NeiSwift/Public/MealInfo/MealInfoFetchable+default.swift deleted file mode 100644 index 02adcf1..0000000 --- a/Sources/NeiSwift/Public/MealInfo/MealInfoFetchable+default.swift +++ /dev/null @@ -1,67 +0,0 @@ -import Combine -import Foundation - -public extension MealInfoFetchable { - /** - 학교에서 제공하는 현재년도 급식의 요리명, 원산지정보, 칼로리정보, 영양정보 등의 일자별 현황입니다. - - * 요리명에 표시된 번호는 알레르기를 유발할수 있는 식재료입니다 (1.난류, 2.우유, 3.메밀, 4.땅콩, 5.대두, 6.밀, 7.고등어, 8.게, 9.새우, 10.돼지고기, 11.복숭아, 12.토마토, 13.아황산염, 14.호두, 15.닭고기, 16.쇠고기, 17.오징어, 18.조개류(굴,전복,홍합 등) - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - MMEAL_SC_CODE: (Optional) 식사코드 - - MLSV_YMD: (Optional) 급식일자 - - MLSV_FROM_YMD: (Optional) 급식일자(시작일자) - - MLSV_TO_YMD: (Optional) 급식일자(종료일자) - - completion: `Result<[MealInfoResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchMealInfo( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - completion: @escaping (Result<[MealInfoResponse], Error>) -> Void - ) { - self.fetchMealInfo( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - MMEAL_SC_CODE: nil, - MLSV_YMD: nil, - MLSV_FROM_YMD: nil, - MLSV_TO_YMD: nil, - completion: completion - ) - } - - func fetchMealInfo( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - MMEAL_SC_CODE: String? = nil, - MLSV_YMD: String? = nil, - MLSV_FROM_YMD: String? = nil, - MLSV_TO_YMD: String? = nil, - completion: @escaping (Result<[MealInfoResponse], Error>) -> Void - ) { - self.fetchMealInfo( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - MMEAL_SC_CODE: MMEAL_SC_CODE, - MLSV_YMD: MLSV_YMD, - MLSV_FROM_YMD: MLSV_FROM_YMD, - MLSV_TO_YMD: MLSV_TO_YMD, - completion: completion - ) - } -} diff --git a/Sources/NeiSwift/Public/MealInfo/MealInfoFetchable.swift b/Sources/NeiSwift/Public/MealInfo/MealInfoFetchable.swift deleted file mode 100644 index a945db2..0000000 --- a/Sources/NeiSwift/Public/MealInfo/MealInfoFetchable.swift +++ /dev/null @@ -1,35 +0,0 @@ -import Combine -import Foundation - -public protocol MealInfoFetchable { - /** - 학교에서 제공하는 현재년도 급식의 요리명, 원산지정보, 칼로리정보, 영양정보 등의 일자별 현황입니다. - - * 요리명에 표시된 번호는 알레르기를 유발할수 있는 식재료입니다 (1.난류, 2.우유, 3.메밀, 4.땅콩, 5.대두, 6.밀, 7.고등어, 8.게, 9.새우, 10.돼지고기, 11.복숭아, 12.토마토, 13.아황산염, 14.호두, 15.닭고기, 16.쇠고기, 17.오징어, 18.조개류(굴,전복,홍합 등)) - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - MMEAL_SC_CODE: (Optional) 식사코드 - - MLSV_YMD: (Optional) 급식일자 - - MLSV_FROM_YMD: (Optional) 급식일자(시작일자) - - MLSV_TO_YMD: (Optional) 급식일자(종료일자) - - completion: `Result<[MealInfoResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchMealInfo( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - MMEAL_SC_CODE: String?, - MLSV_YMD: String?, - MLSV_FROM_YMD: String?, - MLSV_TO_YMD: String?, - completion: @escaping (Result<[MealInfoResponse - ], Error>) -> Void - ) -} diff --git a/Sources/NeiSwift/Public/MisTimeTable/MisTimeTableFetchable+Neis.swift b/Sources/NeiSwift/Public/MisTimeTable/MisTimeTableFetchable+Neis.swift deleted file mode 100644 index 83f47c0..0000000 --- a/Sources/NeiSwift/Public/MisTimeTable/MisTimeTableFetchable+Neis.swift +++ /dev/null @@ -1,45 +0,0 @@ -import Combine -import Foundation - -public extension MisTimeTableFetchable where Self: NeisRequestable { - func fetchMisTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String?, - completion: @escaping (Result<[MisTimeTableResponse], Error>) -> Void - ) { - let parameters: [URLQueryItem] = [ - "KEY": key, - "Type": "json", - "pIndex": "\(pIndex)", - "pSize": "\(pSize)", - "ATPT_OFCDC_SC_CODE": ATPT_OFCDC_SC_CODE, - "SD_SCHUL_CODE": SD_SCHUL_CODE, - "AY": AY, - "SEM": SEM, - "ALL_TI_YMD": ALL_TI_YMD, - "GRADE": GRADE, - "CLASS_NM": CLASS_NM, - "PERIO": PERIO, - "TI_FROM_YMD": TI_FROM_YMD, - "TI_TO_YMD": TI_TO_YMD - ] - .reduce(into: [URLQueryItem]()) { partialResult, dict in - guard let value = dict.value else { return } - let item = URLQueryItem(name: dict.key, value: value) - partialResult.append(item) - } - - neisRequest(key: "misTimetable", parameters: parameters, completion: completion) - } -} diff --git a/Sources/NeiSwift/Public/MisTimeTable/MisTimeTableFetchable+default.swift b/Sources/NeiSwift/Public/MisTimeTable/MisTimeTableFetchable+default.swift deleted file mode 100644 index 7966264..0000000 --- a/Sources/NeiSwift/Public/MisTimeTable/MisTimeTableFetchable+default.swift +++ /dev/null @@ -1,81 +0,0 @@ -import Combine -import Foundation - -public extension MisTimeTableFetchable { - /** - 중학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - completion: `Result<[MisTimeTableResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchMisTimeTable( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - completion: @escaping (Result<[MisTimeTableResponse], Error>) -> Void - ) { - self.fetchMisTimeTable( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - SEM: nil, - ALL_TI_YMD: nil, - GRADE: nil, - CLASS_NM: nil, - PERIO: nil, - TI_FROM_YMD: nil, - TI_TO_YMD: nil, - completion: completion - ) - } - - func fetchMisTimeTable( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - SEM: String? = nil, - ALL_TI_YMD: String? = nil, - GRADE: String? = nil, - CLASS_NM: String? = nil, - PERIO: String? = nil, - TI_FROM_YMD: String? = nil, - TI_TO_YMD: String? = nil, - completion: @escaping (Result<[MisTimeTableResponse], Error>) -> Void - ) { - self.fetchMisTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - GRADE: GRADE, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD, - completion: completion - ) - } -} diff --git a/Sources/NeiSwift/Public/MisTimeTable/MisTimeTableFetchable.swift b/Sources/NeiSwift/Public/MisTimeTable/MisTimeTableFetchable.swift deleted file mode 100644 index 5d6513a..0000000 --- a/Sources/NeiSwift/Public/MisTimeTable/MisTimeTableFetchable.swift +++ /dev/null @@ -1,40 +0,0 @@ -import Combine -import Foundation - -public protocol MisTimeTableFetchable { - /** - 중학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - GRADE: (Optional) 학년 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - completion: `Result<[MisTimeTableResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchMisTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - GRADE: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String?, - completion: @escaping (Result<[MisTimeTableResponse], Error>) -> Void - ) -} diff --git a/Sources/NeiSwift/Public/Neis+Adoption.swift b/Sources/NeiSwift/Public/Neis+Adoption.swift deleted file mode 100644 index 952ba66..0000000 --- a/Sources/NeiSwift/Public/Neis+Adoption.swift +++ /dev/null @@ -1,13 +0,0 @@ - -extension Neis: - AcaInsTiInfoFetchable, - ClassInfoFetchable, - ElsTimeTableFetchable, - HisTimeTableFetchable, - MealInfoFetchable, - MisTimeTableFetchable, - SchoolDepartmentFetchable, - SchoolInfoFetchable, - SchulAflcoinfoFetchable, - SpsTimeTableFetchable, - TimeTableClassRoomInfoFetchable {} diff --git a/Sources/NeiSwift/Public/Neis.swift b/Sources/NeiSwift/Public/Neis.swift index 7859ed4..c2d19bf 100644 --- a/Sources/NeiSwift/Public/Neis.swift +++ b/Sources/NeiSwift/Public/Neis.swift @@ -1,6 +1,6 @@ import Foundation -public struct Neis: HasURLSession, HasNeisParser, NeisRequestable { +public struct Neis: HasURLSession, HasNeisParser, NeisURLBuildable, NeisRequestable, NeisProtocol { public var urlSession: URLSession public var neisParser: any NeisParserProtocol diff --git a/Sources/NeiSwift/Public/NeisConstants.swift b/Sources/NeiSwift/Public/NeisConstants.swift deleted file mode 100644 index 20419b3..0000000 --- a/Sources/NeiSwift/Public/NeisConstants.swift +++ /dev/null @@ -1,5 +0,0 @@ -import Foundation - -public enum NeisConstants { - static let baseNeisURL = "https://open.neis.go.kr/hub" -} diff --git a/Sources/NeiSwift/Public/NeisProtocol+Impl.swift b/Sources/NeiSwift/Public/NeisProtocol+Impl.swift new file mode 100644 index 0000000..772eb57 --- /dev/null +++ b/Sources/NeiSwift/Public/NeisProtocol+Impl.swift @@ -0,0 +1,100 @@ +import Foundation + +public extension NeisProtocol where Self: NeisRequestable { + func fetchAcaInsTiList( + request: AcaInsTiInfoRequest, + completion: @escaping (Result<[AcaInsTiInfoResponse], Error>) -> Void + ) { + let parameters = request.toDictionary().buildParameters() + neisRequest(key: "acaInsTiInfo", parameters: parameters, completion: completion) + } + + func fetchClassInfo( + request: ClassInfoRequest, + completion: @escaping (Result<[ClassInfoResponse], Error>) -> Void + ) { + let parameters = request.toDictionary().buildParameters() + neisRequest(key: "classInfo", parameters: parameters, completion: completion) + } + + func fetchElsTimeTable( + request: ElsTimeTableRequest, + completion: @escaping (Result<[ElsTimeTableResponse], Error>) -> Void + ) { + let parameters = request.toDictionary().buildParameters() + neisRequest(key: "elsTimetable", parameters: parameters, completion: completion) + } + + func fetchHisTimeTable( + request: HisTimeTableRequest, + completion: @escaping (Result<[HisTimeTableResponse], Error>) -> Void + ) { + let parameters = request.toDictionary().buildParameters() + neisRequest(key: "hisTimetable", parameters: parameters, completion: completion) + } + + func fetchMealInfo( + request: MealInfoRequest, + completion: @escaping (Result<[MealInfoResponse], Error>) -> Void + ) { + let parameters = request.toDictionary().buildParameters() + neisRequest(key: "mealServiceDietInfo", parameters: parameters, completion: completion) + } + + func fetchMisTimeTable( + request: MisTimeTableRequest, + completion: @escaping (Result<[MisTimeTableResponse], Error>) -> Void + ) { + let parameters = request.toDictionary().buildParameters() + neisRequest(key: "misTimetable", parameters: parameters, completion: completion) + } + + func fetchSchoolDepartmentList( + request: SchoolDepartmentRequest, + completion: @escaping (Result<[SchoolDepartmentResponse], Error>) -> Void + ) { + let parameters = request.toDictionary().buildParameters() + neisRequest(key: "schoolMajorinfo", parameters: parameters, completion: completion) + } + + func fetchSchoolList( + request: SchoolInfoRequest, + completion: @escaping (Result<[SchoolInfoResponse], Error>) -> Void + ) { + let parameters = request.toDictionary().buildParameters() + neisRequest(key: "schoolInfo", parameters: parameters, completion: completion) + } + + func fetchSchulAflcoinfoList( + request: SchulAflcoinfoRequest, + completion: @escaping (Result<[SchulAflcoinfoResponse], Error>) -> Void + ) { + let parameters = request.toDictionary().buildParameters() + neisRequest(key: "schulAflcoinfo", parameters: parameters, completion: completion) + } + + func fetchSpsTimeTable( + request: SpsTimeTableRequest, + completion: @escaping (Result<[SpsTimeTableResponse], Error>) -> Void + ) { + let parameters = request.toDictionary().buildParameters() + neisRequest(key: "spsTimetable", parameters: parameters, completion: completion) + } + + func fetchTimeTableClassRoom( + request: TimeTableClassRoomInfoRequest, + completion: @escaping (Result<[TimeTableClassRoomInfoResponse], Error>) -> Void + ) { + let parameters = request.toDictionary().buildParameters() + neisRequest(key: "tiClrminfo", parameters: parameters, completion: completion) + } +} + +private extension Dictionary where Key == String, Value == Any { + func buildParameters() -> [URLQueryItem] { + self.reduce(into: [URLQueryItem]()) { partialResult, dict in + guard let value = dict.value as? String else { return } + partialResult.append(URLQueryItem(name: dict.key, value: value)) + } + } +} diff --git a/Sources/NeiSwift/Public/NeisProtocol.swift b/Sources/NeiSwift/Public/NeisProtocol.swift new file mode 100644 index 0000000..f7fc117 --- /dev/null +++ b/Sources/NeiSwift/Public/NeisProtocol.swift @@ -0,0 +1,244 @@ +import Foundation + +public protocol NeisProtocol { + /** + 개설되어있는 학원 및 교습소의 학원명, 휴원일자, 등록상태, 정원, 분야, 계열 및 과정등을 확인할 수 있으며 수강료 공개여부에 따라 수강료 내용을 확인할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - ADMST_ZONE_NM: (Optional) 행정구역명 + - ACA_ASNUM: (Optional) 학원지정번호 + - ACA_NM: (Optional) 학원명 + - REALM_SC_NM: (Optional) 분야명 + - LE_ORD_NM: (Optional) 교습계열명 + - LE_CRSE_NM: (Optional) 교습과정명 + - completion: `Result<[AcaInsTiInfoResponse], Error>`를 사용할 수 있는 클로저 + */ + func fetchAcaInsTiList( + request: AcaInsTiInfoRequest, + completion: @escaping (Result<[AcaInsTiInfoResponse], Error>) -> Void + ) + + /** + 학교명 등의 검색 조건을 선택하여 반정보를 검색할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - GRADE: (Optional) 학년 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 + - ORD_SC_NM: (Optional) 계열명 + - DDDEP_NM: (Optional) 학과명 + - completion: `Result<[ClassInfoResponse], Error>`를 사용할 수 있는 클로저 + */ + func fetchClassInfo( + request: ClassInfoRequest, + completion: @escaping (Result<[ClassInfoResponse], Error>) -> Void + ) + + /** + 초등학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다 + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - GRADE: (Optional) 학년 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + - completion: `Result<[ElsTimeTableResponse], Error>`를 사용할 수 있는 클로저 + */ + func fetchElsTimeTable( + request: ElsTimeTableRequest, + completion: @escaping (Result<[ElsTimeTableResponse], Error>) -> Void + ) + + /** + 고등학교 학년도, 학교, 계열, 학과, 학기, 학년, 강의실, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - GRADE: (Optional) 학년 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + - completion: `Result<[HisTimeTableResponse], Error>`를 사용할 수 있는 클로저 + */ + func fetchHisTimeTable( + request: HisTimeTableRequest, + completion: @escaping (Result<[HisTimeTableResponse], Error>) -> Void + ) + + /** + 학교에서 제공하는 현재년도 급식의 요리명, 원산지정보, 칼로리정보, 영양정보 등의 일자별 현황입니다. + + * 요리명에 표시된 번호는 알레르기를 유발할수 있는 식재료입니다 (1.난류, 2.우유, 3.메밀, 4.땅콩, 5.대두, 6.밀, 7.고등어, 8.게, 9.새우, 10.돼지고기, 11.복숭아, 12.토마토, 13.아황산염, 14.호두, 15.닭고기, 16.쇠고기, 17.오징어, 18.조개류(굴,전복,홍합 등)) + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - MMEAL_SC_CODE: (Optional) 식사코드 + - MLSV_YMD: (Optional) 급식일자 + - MLSV_FROM_YMD: (Optional) 급식일자(시작일자) + - MLSV_TO_YMD: (Optional) 급식일자(종료일자) + - completion: `Result<[MealInfoResponse], Error>`를 사용할 수 있는 클로저 + */ + func fetchMealInfo( + request: MealInfoRequest, + completion: @escaping (Result<[MealInfoResponse], Error>) -> Void + ) + + /** + 중학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - GRADE: (Optional) 학년 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + - completion: `Result<[MisTimeTableResponse], Error>`를 사용할 수 있는 클로저 + */ + func fetchMisTimeTable( + request: MisTimeTableRequest, + completion: @escaping (Result<[MisTimeTableResponse], Error>) -> Void + ) + + /** + 학교별 학과 정보를 조회할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: (Optional) 표준학교코드 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - ORD_SC_NM: (Optional) 계열명 + - completion: `Result<[SchoolDepartmentResponse], Error>`를 사용할 수 있는 클로저 + */ + func fetchSchoolDepartmentList( + request: SchoolDepartmentRequest, + completion: @escaping (Result<[SchoolDepartmentResponse], Error>) -> Void + ) + + /** + 학교 기본정보에 대한 학교명, 소재지, 주소, 전화번호, 홈페이지주소, 남녀공학여부, 주야구분, 개교기념일 등을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: (Optional) 시도교육청코드 + - SD_SCHUL_CODE: (Optional) 표준학교코드 + - SCHUL_NM: (Optional) 학교명 + - SCHUL_KND_SC_NM: (Optional) 학교 종류명 + - LCTN_SC_NM: (Optional) 소재지명 + - FOND_SC_NM: (Optional) 설립명 + - completion: `Result<[SchoolInfoResponse], Error>`를 사용할 수 있는 클로저 + */ + func fetchSchoolList( + request: SchoolInfoRequest, + completion: @escaping (Result<[SchoolInfoResponse], Error>) -> Void + ) + + /** + 학교명 등의 검색 조건을 선택하여 학교계열정보를 검색할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: (Optional) 표준학교코드 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - completion: `Result<[SchulAflcoinfoResponse], Error>`를 사용할 수 있는 클로저 + */ + func fetchSchulAflcoinfoList( + request: SchulAflcoinfoRequest, + completion: @escaping (Result<[SchulAflcoinfoResponse], Error>) -> Void + ) + + /** + 특수학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 위치 + - pSize: 페이지 당 신청 숫자 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 표준학교코드 + - AY: (Optional) 학년도 + - SEM: (Optional) 학기 + - ALL_TI_YMD: (Optional) 시간표일자 + - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 + - GRADE: (Optional) 학년 + - CLRM_NM: (Optional) 강의실명 + - CLASS_NM: (Optional) 반명 + - PERIO: (Optional) 교시 + - TI_FROM_YMD: (Optional) 시간표시작일자 + - TI_TO_YMD: (Optional) 시간표종료일자 + - completion: `Result<[SpsTimeTableResponse], Error>`를 사용할 수 있는 클로저 + */ + func fetchSpsTimeTable( + request: SpsTimeTableRequest, + completion: @escaping (Result<[SpsTimeTableResponse], Error>) -> Void + ) + + /** + 학교명 등의 검색 조건을 선택하여 시간표강의실 정보를 검색 할 수 있습니다. + + - Parameters: + - key: 인증키 + - pIndex: 페이지 번호 + - pSize: 한 페이지 결과 수 + - ATPT_OFCDC_SC_CODE: 시도교육청코드 + - SD_SCHUL_CODE: 학교코드 + - AY: (Optional) 학년도 + - GRADE: (Optional) 학년 + - SEM: (Optional) 학기 + - SCHUL_CRSE_SC_NM: (Optional) 학교종류명 + - DGHT_CRSE_SC_NM: (Optional) 주야과정명 + - ORD_SC_NM: (Optional) 계열명 + - DDDEP_NM: (Optional) 학과명 + - completion: `Result<[TimeTableClassRoomInfoResponse], Error>`를 사용할 수 있는 클로저 + */ + func fetchTimeTableClassRoom( + request: TimeTableClassRoomInfoRequest, + completion: @escaping (Result<[TimeTableClassRoomInfoResponse], Error>) -> Void + ) +} diff --git a/Sources/NeiSwift/Public/Request/AcaInsTiInfoRequest.swift b/Sources/NeiSwift/Public/Request/AcaInsTiInfoRequest.swift new file mode 100644 index 0000000..e2708e9 --- /dev/null +++ b/Sources/NeiSwift/Public/Request/AcaInsTiInfoRequest.swift @@ -0,0 +1,38 @@ +import Foundation + +public struct AcaInsTiInfoRequest: Encodable, DictionaryConvertable { + public let key: String + public let pIndex: Int + public let pSize: Int + public let ATPT_OFCDC_SC_CODE: String + public let ADMST_ZONE_NM: String? + public let ACA_ASNUM: String? + public let ACA_NM: String? + public let REALM_SC_NM: String? + public let LE_ORD_NM: String? + public let LE_CRSE_NM: String? + + public init( + key: String, + pIndex: Int = 1, + pSize: Int = 100, + ATPT_OFCDC_SC_CODE: String, + ADMST_ZONE_NM: String? = nil, + ACA_ASNUM: String? = nil, + ACA_NM: String? = nil, + REALM_SC_NM: String? = nil, + LE_ORD_NM: String? = nil, + LE_CRSE_NM: String? = nil + ) { + self.key = key + self.pIndex = pIndex + self.pSize = pSize + self.ATPT_OFCDC_SC_CODE = ATPT_OFCDC_SC_CODE + self.ADMST_ZONE_NM = ADMST_ZONE_NM + self.ACA_ASNUM = ACA_ASNUM + self.ACA_NM = ACA_NM + self.REALM_SC_NM = REALM_SC_NM + self.LE_ORD_NM = LE_ORD_NM + self.LE_CRSE_NM = LE_CRSE_NM + } +} diff --git a/Sources/NeiSwift/Public/Request/ClassInfoRequest.swift b/Sources/NeiSwift/Public/Request/ClassInfoRequest.swift new file mode 100644 index 0000000..4490156 --- /dev/null +++ b/Sources/NeiSwift/Public/Request/ClassInfoRequest.swift @@ -0,0 +1,41 @@ +import Foundation + +public struct ClassInfoRequest: Encodable, DictionaryConvertable { + public let key: String + public let pIndex: Int + public let pSize: Int + public let ATPT_OFCDC_SC_CODE: String + public let SD_SCHUL_CODE: String + public let AY: String? + public let GRADE: String? + public let DGHT_CRSE_SC_NM: String? + public let SCHUL_CRSE_SC_NM: String? + public let ORD_SC_NM: String? + public let DDDEP_NM: String? + + public init( + key: String, + pIndex: Int = 1, + pSize: Int = 100, + ATPT_OFCDC_SC_CODE: String, + SD_SCHUL_CODE: String, + AY: String? = nil, + GRADE: String? = nil, + DGHT_CRSE_SC_NM: String? = nil, + SCHUL_CRSE_SC_NM: String? = nil, + ORD_SC_NM: String? = nil, + DDDEP_NM: String? = nil + ) { + self.key = key + self.pIndex = pIndex + self.pSize = pSize + self.ATPT_OFCDC_SC_CODE = ATPT_OFCDC_SC_CODE + self.SD_SCHUL_CODE = SD_SCHUL_CODE + self.AY = AY + self.GRADE = GRADE + self.DGHT_CRSE_SC_NM = DGHT_CRSE_SC_NM + self.SCHUL_CRSE_SC_NM = SCHUL_CRSE_SC_NM + self.ORD_SC_NM = ORD_SC_NM + self.DDDEP_NM = DDDEP_NM + } +} diff --git a/Sources/NeiSwift/Public/Request/ElsTimeTableRequest.swift b/Sources/NeiSwift/Public/Request/ElsTimeTableRequest.swift new file mode 100644 index 0000000..745cf38 --- /dev/null +++ b/Sources/NeiSwift/Public/Request/ElsTimeTableRequest.swift @@ -0,0 +1,47 @@ +import Foundation + +public struct ElsTimeTableRequest: Encodable, DictionaryConvertable { + public let key: String + public let pIndex: Int + public let pSize: Int + public let ATPT_OFCDC_SC_CODE: String + public let SD_SCHUL_CODE: String + public let AY: String? + public let SEM: String? + public let ALL_TI_YMD: String? + public let GRADE: String? + public let CLASS_NM: String? + public let PERIO: String? + public let TI_FROM_YMD: String? + public let TI_TO_YMD: String? + + public init( + key: String, + pIndex: Int = 1, + pSize: Int = 100, + ATPT_OFCDC_SC_CODE: String, + SD_SCHUL_CODE: String, + AY: String? = nil, + SEM: String? = nil, + ALL_TI_YMD: String? = nil, + GRADE: String? = nil, + CLASS_NM: String? = nil, + PERIO: String? = nil, + TI_FROM_YMD: String? = nil, + TI_TO_YMD: String? = nil + ) { + self.key = key + self.pIndex = pIndex + self.pSize = pSize + self.ATPT_OFCDC_SC_CODE = ATPT_OFCDC_SC_CODE + self.SD_SCHUL_CODE = SD_SCHUL_CODE + self.AY = AY + self.SEM = SEM + self.ALL_TI_YMD = ALL_TI_YMD + self.GRADE = GRADE + self.CLASS_NM = CLASS_NM + self.PERIO = PERIO + self.TI_FROM_YMD = TI_FROM_YMD + self.TI_TO_YMD = TI_TO_YMD + } +} diff --git a/Sources/NeiSwift/Public/Request/HisTimeTableRequest.swift b/Sources/NeiSwift/Public/Request/HisTimeTableRequest.swift new file mode 100644 index 0000000..01b63c1 --- /dev/null +++ b/Sources/NeiSwift/Public/Request/HisTimeTableRequest.swift @@ -0,0 +1,47 @@ +import Foundation + +public struct HisTimeTableRequest: Encodable, DictionaryConvertable { + public let key: String + public let pIndex: Int + public let pSize: Int + public let ATPT_OFCDC_SC_CODE: String + public let SD_SCHUL_CODE: String + public let AY: String? + public let SEM: String? + public let ALL_TI_YMD: String? + public let GRADE: String? + public let CLASS_NM: String? + public let PERIO: String? + public let TI_FROM_YMD: String? + public let TI_TO_YMD: String? + + public init( + key: String, + pIndex: Int = 1, + pSize: Int = 100, + ATPT_OFCDC_SC_CODE: String, + SD_SCHUL_CODE: String, + AY: String? = nil, + SEM: String? = nil, + ALL_TI_YMD: String? = nil, + GRADE: String? = nil, + CLASS_NM: String? = nil, + PERIO: String? = nil, + TI_FROM_YMD: String? = nil, + TI_TO_YMD: String? = nil + ) { + self.key = key + self.pIndex = pIndex + self.pSize = pSize + self.ATPT_OFCDC_SC_CODE = ATPT_OFCDC_SC_CODE + self.SD_SCHUL_CODE = SD_SCHUL_CODE + self.AY = AY + self.SEM = SEM + self.ALL_TI_YMD = ALL_TI_YMD + self.GRADE = GRADE + self.CLASS_NM = CLASS_NM + self.PERIO = PERIO + self.TI_FROM_YMD = TI_FROM_YMD + self.TI_TO_YMD = TI_TO_YMD + } +} diff --git a/Sources/NeiSwift/Public/Request/MealInfoRequest.swift b/Sources/NeiSwift/Public/Request/MealInfoRequest.swift new file mode 100644 index 0000000..49de2f0 --- /dev/null +++ b/Sources/NeiSwift/Public/Request/MealInfoRequest.swift @@ -0,0 +1,35 @@ +import Foundation + +public struct MealInfoRequest: Encodable, DictionaryConvertable { + public let key: String + public let pIndex: Int + public let pSize: Int + public let ATPT_OFCDC_SC_CODE: String + public let SD_SCHUL_CODE: String + public let MMEAL_SC_CODE: String? + public let MLSV_YMD: String? + public let MLSV_FROM_YMD: String? + public let MLSV_TO_YMD: String? + + public init( + key: String, + pIndex: Int = 1, + pSize: Int = 100, + ATPT_OFCDC_SC_CODE: String, + SD_SCHUL_CODE: String, + MMEAL_SC_CODE: String? = nil, + MLSV_YMD: String? = nil, + MLSV_FROM_YMD: String? = nil, + MLSV_TO_YMD: String? = nil + ) { + self.key = key + self.pIndex = pIndex + self.pSize = pSize + self.ATPT_OFCDC_SC_CODE = ATPT_OFCDC_SC_CODE + self.SD_SCHUL_CODE = SD_SCHUL_CODE + self.MMEAL_SC_CODE = MMEAL_SC_CODE + self.MLSV_YMD = MLSV_YMD + self.MLSV_FROM_YMD = MLSV_FROM_YMD + self.MLSV_TO_YMD = MLSV_TO_YMD + } +} diff --git a/Sources/NeiSwift/Public/Request/MisTimeTableRequest.swift b/Sources/NeiSwift/Public/Request/MisTimeTableRequest.swift new file mode 100644 index 0000000..befda3c --- /dev/null +++ b/Sources/NeiSwift/Public/Request/MisTimeTableRequest.swift @@ -0,0 +1,47 @@ +import Foundation + +public struct MisTimeTableRequest: Encodable, DictionaryConvertable { + public let key: String + public let pIndex: Int + public let pSize: Int + public let ATPT_OFCDC_SC_CODE: String + public let SD_SCHUL_CODE: String + public let AY: String? + public let SEM: String? + public let ALL_TI_YMD: String? + public let GRADE: String? + public let CLASS_NM: String? + public let PERIO: String? + public let TI_FROM_YMD: String? + public let TI_TO_YMD: String? + + public init( + key: String, + pIndex: Int = 1, + pSize: Int = 100, + ATPT_OFCDC_SC_CODE: String, + SD_SCHUL_CODE: String, + AY: String? = nil, + SEM: String? = nil, + ALL_TI_YMD: String? = nil, + GRADE: String? = nil, + CLASS_NM: String? = nil, + PERIO: String? = nil, + TI_FROM_YMD: String? = nil, + TI_TO_YMD: String? = nil + ) { + self.key = key + self.pIndex = pIndex + self.pSize = pSize + self.ATPT_OFCDC_SC_CODE = ATPT_OFCDC_SC_CODE + self.SD_SCHUL_CODE = SD_SCHUL_CODE + self.AY = AY + self.SEM = SEM + self.ALL_TI_YMD = ALL_TI_YMD + self.GRADE = GRADE + self.CLASS_NM = CLASS_NM + self.PERIO = PERIO + self.TI_FROM_YMD = TI_FROM_YMD + self.TI_TO_YMD = TI_TO_YMD + } +} diff --git a/Sources/NeiSwift/Public/Request/SchoolDepartmentRequest.swift b/Sources/NeiSwift/Public/Request/SchoolDepartmentRequest.swift new file mode 100644 index 0000000..36a8529 --- /dev/null +++ b/Sources/NeiSwift/Public/Request/SchoolDepartmentRequest.swift @@ -0,0 +1,29 @@ +import Foundation + +public struct SchoolDepartmentRequest: Encodable, DictionaryConvertable { + public let key: String + public let pIndex: Int + public let pSize: Int + public let ATPT_OFCDC_SC_CODE: String + public let SD_SCHUL_CODE: String? + public let DGHT_CRSE_SC_NM: String? + public let ORD_SC_NM: String? + + public init( + key: String, + pIndex: Int = 1, + pSize: Int = 100, + ATPT_OFCDC_SC_CODE: String, + SD_SCHUL_CODE: String? = nil, + DGHT_CRSE_SC_NM: String? = nil, + ORD_SC_NM: String? = nil + ) { + self.key = key + self.pIndex = pIndex + self.pSize = pSize + self.ATPT_OFCDC_SC_CODE = ATPT_OFCDC_SC_CODE + self.SD_SCHUL_CODE = SD_SCHUL_CODE + self.DGHT_CRSE_SC_NM = DGHT_CRSE_SC_NM + self.ORD_SC_NM = ORD_SC_NM + } +} diff --git a/Sources/NeiSwift/Public/Request/SchoolInfoRequest.swift b/Sources/NeiSwift/Public/Request/SchoolInfoRequest.swift new file mode 100644 index 0000000..53290e9 --- /dev/null +++ b/Sources/NeiSwift/Public/Request/SchoolInfoRequest.swift @@ -0,0 +1,35 @@ +import Foundation + +public struct SchoolInfoRequest: Encodable, DictionaryConvertable { + public let key: String + public let pIndex: Int + public let pSize: Int + public let ATPT_OFCDC_SC_CODE: String? + public let SD_SCHUL_CODE: String? + public let SCHUL_NM: String? + public let SCHUL_KND_SC_NM: String? + public let LCTN_SC_NM: String? + public let FOND_SC_NM: String? + + public init( + key: String, + pIndex: Int = 1, + pSize: Int = 100, + ATPT_OFCDC_SC_CODE: String? = nil, + SD_SCHUL_CODE: String? = nil, + SCHUL_NM: String? = nil, + SCHUL_KND_SC_NM: String? = nil, + LCTN_SC_NM: String? = nil, + FOND_SC_NM: String? = nil + ) { + self.key = key + self.pIndex = pIndex + self.pSize = pSize + self.ATPT_OFCDC_SC_CODE = ATPT_OFCDC_SC_CODE + self.SD_SCHUL_CODE = SD_SCHUL_CODE + self.SCHUL_NM = SCHUL_NM + self.SCHUL_KND_SC_NM = SCHUL_KND_SC_NM + self.LCTN_SC_NM = LCTN_SC_NM + self.FOND_SC_NM = FOND_SC_NM + } +} diff --git a/Sources/NeiSwift/Public/Request/SchulAflcoinfoRequest.swift b/Sources/NeiSwift/Public/Request/SchulAflcoinfoRequest.swift new file mode 100644 index 0000000..04d9d39 --- /dev/null +++ b/Sources/NeiSwift/Public/Request/SchulAflcoinfoRequest.swift @@ -0,0 +1,26 @@ +import Foundation + +public struct SchulAflcoinfoRequest: Encodable, DictionaryConvertable { + public let key: String + public let pIndex: Int + public let pSize: Int + public let ATPT_OFCDC_SC_CODE: String + public let SD_SCHUL_CODE: String? + public let DGHT_CRSE_SC_NM: String? + + public init( + key: String, + pIndex: Int = 1, + pSize: Int = 100, + ATPT_OFCDC_SC_CODE: String, + SD_SCHUL_CODE: String? = nil, + DGHT_CRSE_SC_NM: String? = nil + ) { + self.key = key + self.pIndex = pIndex + self.pSize = pSize + self.ATPT_OFCDC_SC_CODE = ATPT_OFCDC_SC_CODE + self.SD_SCHUL_CODE = SD_SCHUL_CODE + self.DGHT_CRSE_SC_NM = DGHT_CRSE_SC_NM + } +} diff --git a/Sources/NeiSwift/Public/Request/SpsTimeTableRequest.swift b/Sources/NeiSwift/Public/Request/SpsTimeTableRequest.swift new file mode 100644 index 0000000..cf27310 --- /dev/null +++ b/Sources/NeiSwift/Public/Request/SpsTimeTableRequest.swift @@ -0,0 +1,53 @@ +import Foundation + +public struct SpsTimeTableRequest: Encodable, DictionaryConvertable { + public let key: String + public let pIndex: Int + public let pSize: Int + public let ATPT_OFCDC_SC_CODE: String + public let SD_SCHUL_CODE: String + public let AY: String? + public let SEM: String? + public let ALL_TI_YMD: String? + public let SCHUL_CRSE_SC_NM: String? + public let GRADE: String? + public let CLRM_NM: String? + public let CLASS_NM: String? + public let PERIO: String? + public let TI_FROM_YMD: String? + public let TI_TO_YMD: String? + + public init( + key: String, + pIndex: Int = 1, + pSize: Int = 100, + ATPT_OFCDC_SC_CODE: String, + SD_SCHUL_CODE: String, + AY: String? = nil, + SEM: String? = nil, + ALL_TI_YMD: String? = nil, + SCHUL_CRSE_SC_NM: String? = nil, + GRADE: String? = nil, + CLRM_NM: String? = nil, + CLASS_NM: String? = nil, + PERIO: String? = nil, + TI_FROM_YMD: String? = nil, + TI_TO_YMD: String? = nil + ) { + self.key = key + self.pIndex = pIndex + self.pSize = pSize + self.ATPT_OFCDC_SC_CODE = ATPT_OFCDC_SC_CODE + self.SD_SCHUL_CODE = SD_SCHUL_CODE + self.AY = AY + self.SEM = SEM + self.ALL_TI_YMD = ALL_TI_YMD + self.SCHUL_CRSE_SC_NM = SCHUL_CRSE_SC_NM + self.GRADE = GRADE + self.CLRM_NM = CLRM_NM + self.CLASS_NM = CLASS_NM + self.PERIO = PERIO + self.TI_FROM_YMD = TI_FROM_YMD + self.TI_TO_YMD = TI_TO_YMD + } +} diff --git a/Sources/NeiSwift/Public/Request/TimeTableClassRoomInfoRequest.swift b/Sources/NeiSwift/Public/Request/TimeTableClassRoomInfoRequest.swift new file mode 100644 index 0000000..bb4de8e --- /dev/null +++ b/Sources/NeiSwift/Public/Request/TimeTableClassRoomInfoRequest.swift @@ -0,0 +1,44 @@ +import Foundation + +public struct TimeTableClassRoomInfoRequest: Encodable, DictionaryConvertable { + public let key: String + public let pIndex: Int + public let pSize: Int + public let ATPT_OFCDC_SC_CODE: String + public let SD_SCHUL_CODE: String + public let AY: String? + public let GRADE: String? + public let SEM: String? + public let SCHUL_CRSE_SC_NM: String? + public let DGHT_CRSE_SC_NM: String? + public let ORD_SC_NM: String? + public let DDDEP_NM: String? + + public init( + key: String, + pIndex: Int = 1, + pSize: Int = 100, + ATPT_OFCDC_SC_CODE: String, + SD_SCHUL_CODE: String, + AY: String? = nil, + GRADE: String? = nil, + SEM: String? = nil, + SCHUL_CRSE_SC_NM: String? = nil, + DGHT_CRSE_SC_NM: String? = nil, + ORD_SC_NM: String? = nil, + DDDEP_NM: String? = nil + ) { + self.key = key + self.pIndex = pIndex + self.pSize = pSize + self.ATPT_OFCDC_SC_CODE = ATPT_OFCDC_SC_CODE + self.SD_SCHUL_CODE = SD_SCHUL_CODE + self.AY = AY + self.GRADE = GRADE + self.SEM = SEM + self.SCHUL_CRSE_SC_NM = SCHUL_CRSE_SC_NM + self.DGHT_CRSE_SC_NM = DGHT_CRSE_SC_NM + self.ORD_SC_NM = ORD_SC_NM + self.DDDEP_NM = DDDEP_NM + } +} diff --git a/Sources/NeiSwift/Public/AcaInsTiInfo/Response/AcaInsTiInfoResponse.swift b/Sources/NeiSwift/Public/Response/AcaInsTiInfoResponse.swift similarity index 100% rename from Sources/NeiSwift/Public/AcaInsTiInfo/Response/AcaInsTiInfoResponse.swift rename to Sources/NeiSwift/Public/Response/AcaInsTiInfoResponse.swift diff --git a/Sources/NeiSwift/Public/ClassInfo/Response/ClassInfoResponse.swift b/Sources/NeiSwift/Public/Response/ClassInfoResponse.swift similarity index 100% rename from Sources/NeiSwift/Public/ClassInfo/Response/ClassInfoResponse.swift rename to Sources/NeiSwift/Public/Response/ClassInfoResponse.swift diff --git a/Sources/NeiSwift/Public/ElsTimeTable/Response/ElsTimeTableResponse.swift b/Sources/NeiSwift/Public/Response/ElsTimeTableResponse.swift similarity index 100% rename from Sources/NeiSwift/Public/ElsTimeTable/Response/ElsTimeTableResponse.swift rename to Sources/NeiSwift/Public/Response/ElsTimeTableResponse.swift diff --git a/Sources/NeiSwift/Public/HisTimeTable/Response/HisTimeTableResponse.swift b/Sources/NeiSwift/Public/Response/HisTimeTableResponse.swift similarity index 100% rename from Sources/NeiSwift/Public/HisTimeTable/Response/HisTimeTableResponse.swift rename to Sources/NeiSwift/Public/Response/HisTimeTableResponse.swift diff --git a/Sources/NeiSwift/Public/MealInfo/Response/MealInfoResponse.swift b/Sources/NeiSwift/Public/Response/MealInfoResponse.swift similarity index 100% rename from Sources/NeiSwift/Public/MealInfo/Response/MealInfoResponse.swift rename to Sources/NeiSwift/Public/Response/MealInfoResponse.swift diff --git a/Sources/NeiSwift/Public/MisTimeTable/Response/MisTimeTableResponse.swift b/Sources/NeiSwift/Public/Response/MisTimeTableResponse.swift similarity index 100% rename from Sources/NeiSwift/Public/MisTimeTable/Response/MisTimeTableResponse.swift rename to Sources/NeiSwift/Public/Response/MisTimeTableResponse.swift diff --git a/Sources/NeiSwift/Public/SchoolDepartment/Response/SchoolDepartmentResponse.swift b/Sources/NeiSwift/Public/Response/SchoolDepartmentResponse.swift similarity index 100% rename from Sources/NeiSwift/Public/SchoolDepartment/Response/SchoolDepartmentResponse.swift rename to Sources/NeiSwift/Public/Response/SchoolDepartmentResponse.swift diff --git a/Sources/NeiSwift/Public/SchoolInfo/Response/SchoolInfoResponse.swift b/Sources/NeiSwift/Public/Response/SchoolInfoResponse.swift similarity index 100% rename from Sources/NeiSwift/Public/SchoolInfo/Response/SchoolInfoResponse.swift rename to Sources/NeiSwift/Public/Response/SchoolInfoResponse.swift diff --git a/Sources/NeiSwift/Public/SchulAflcoinfo/Response/SchulAflcoinfoResponse.swift b/Sources/NeiSwift/Public/Response/SchulAflcoinfoResponse.swift similarity index 100% rename from Sources/NeiSwift/Public/SchulAflcoinfo/Response/SchulAflcoinfoResponse.swift rename to Sources/NeiSwift/Public/Response/SchulAflcoinfoResponse.swift diff --git a/Sources/NeiSwift/Public/SpsTimeTable/Response/SpsTimeTableResponse.swift b/Sources/NeiSwift/Public/Response/SpsTimeTableResponse.swift similarity index 100% rename from Sources/NeiSwift/Public/SpsTimeTable/Response/SpsTimeTableResponse.swift rename to Sources/NeiSwift/Public/Response/SpsTimeTableResponse.swift diff --git a/Sources/NeiSwift/Public/TimeTableClassRoomInfo/Response/TimeTableClassRoomInfoResponse.swift b/Sources/NeiSwift/Public/Response/TimeTableClassRoomInfoResponse.swift similarity index 100% rename from Sources/NeiSwift/Public/TimeTableClassRoomInfo/Response/TimeTableClassRoomInfoResponse.swift rename to Sources/NeiSwift/Public/Response/TimeTableClassRoomInfoResponse.swift diff --git a/Sources/NeiSwift/Public/SchoolDepartment/SchoolDepartmentFetchable+Neis.swift b/Sources/NeiSwift/Public/SchoolDepartment/SchoolDepartmentFetchable+Neis.swift deleted file mode 100644 index 9a7cdbc..0000000 --- a/Sources/NeiSwift/Public/SchoolDepartment/SchoolDepartmentFetchable+Neis.swift +++ /dev/null @@ -1,33 +0,0 @@ -import Combine -import Foundation - -public extension SchoolDepartmentFetchable where Self: NeisRequestable { - func fetchSchoolDepartmentList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String?, - DGHT_CRSE_SC_NM: String?, - ORD_SC_NM: String?, - completion: @escaping (Result<[SchoolDepartmentResponse], Error>) -> Void - ) { - let parameters: [URLQueryItem] = [ - "KEY": key, - "Type": "json", - "pIndex": "\(pIndex)", - "pSize": "\(pSize)", - "ATPT_OFCDC_SC_CODE": ATPT_OFCDC_SC_CODE, - "SD_SCHUL_CODE": SD_SCHUL_CODE, - "DGHT_CRSE_SC_NM": DGHT_CRSE_SC_NM, - "ORD_SC_NM": ORD_SC_NM - ] - .reduce(into: [URLQueryItem]()) { partialResult, dict in - guard let value = dict.value else { return } - let item = URLQueryItem(name: dict.key, value: value) - partialResult.append(item) - } - - neisRequest(key: "schoolMajorinfo", parameters: parameters, completion: completion) - } -} diff --git a/Sources/NeiSwift/Public/SchoolDepartment/SchoolDepartmentFetchable+default.swift b/Sources/NeiSwift/Public/SchoolDepartment/SchoolDepartmentFetchable+default.swift deleted file mode 100644 index cbfa3c0..0000000 --- a/Sources/NeiSwift/Public/SchoolDepartment/SchoolDepartmentFetchable+default.swift +++ /dev/null @@ -1,56 +0,0 @@ -import Combine -import Foundation - -public extension SchoolDepartmentFetchable { - /** - 학교별 학과 정보를 조회할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - ORD_SC_NM: (Optional) 계열명 - - completion: `Result<[SchoolDepartmentResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchSchoolDepartmentList( - key: String, - ATPT_OFCDC_SC_CODE: String, - completion: @escaping (Result<[SchoolDepartmentResponse], Error>) -> Void - ) { - self.fetchSchoolDepartmentList( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: nil, - DGHT_CRSE_SC_NM: nil, - ORD_SC_NM: nil, - completion: completion - ) - } - - func fetchSchoolDepartmentList( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, /// 시도 교육청 코드 - SD_SCHUL_CODE: String? = nil, /// 표준 학교 코드 - DGHT_CRSE_SC_NM: String? = nil, /// 주야과정명 - ORD_SC_NM: String? = nil, /// 계열명 - completion: @escaping (Result<[SchoolDepartmentResponse], Error>) -> Void - ) { - self.fetchSchoolDepartmentList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - ORD_SC_NM: ORD_SC_NM, - completion: completion - ) - } -} diff --git a/Sources/NeiSwift/Public/SchoolDepartment/SchoolDepartmentFetchable.swift b/Sources/NeiSwift/Public/SchoolDepartment/SchoolDepartmentFetchable.swift deleted file mode 100644 index dd9d084..0000000 --- a/Sources/NeiSwift/Public/SchoolDepartment/SchoolDepartmentFetchable.swift +++ /dev/null @@ -1,28 +0,0 @@ -import Combine -import Foundation - -public protocol SchoolDepartmentFetchable { - /** - 학교별 학과 정보를 조회할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - ORD_SC_NM: (Optional) 계열명 - - completion: `Result<[SchoolDepartmentResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchSchoolDepartmentList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String?, - DGHT_CRSE_SC_NM: String?, - ORD_SC_NM: String?, - completion: @escaping (Result<[SchoolDepartmentResponse], Error>) -> Void - ) -} diff --git a/Sources/NeiSwift/Public/SchoolInfo/SchoolInfoFetchable+Neis.swift b/Sources/NeiSwift/Public/SchoolInfo/SchoolInfoFetchable+Neis.swift deleted file mode 100644 index 424a7f4..0000000 --- a/Sources/NeiSwift/Public/SchoolInfo/SchoolInfoFetchable+Neis.swift +++ /dev/null @@ -1,37 +0,0 @@ -import Combine -import Foundation - -public extension SchoolInfoFetchable where Self: NeisRequestable { - func fetchSchoolList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String?, - SD_SCHUL_CODE: String?, - SCHUL_NM: String?, - SCHUL_KND_SC_NM: String?, - LCTN_SC_NM: String?, - FOND_SC_NM: String?, - completion: @escaping (Result<[SchoolInfoResponse], Error>) -> Void - ) { - let parameters: [URLQueryItem] = [ - "KEY": key, - "Type": "json", - "pIndex": "\(pIndex)", - "pSize": "\(pSize)", - "ATPT_OFCDC_SC_CODE": ATPT_OFCDC_SC_CODE, - "SD_SCHUL_CODE": SD_SCHUL_CODE, - "SCHUL_NM": SCHUL_NM, - "SCHUL_KND_SC_NM": SCHUL_KND_SC_NM, - "LCTN_SC_NM": LCTN_SC_NM, - "FOND_SC_NM": FOND_SC_NM, - ] - .reduce(into: [URLQueryItem]()) { partialResult, dict in - guard let value = dict.value else { return } - let item = URLQueryItem(name: dict.key, value: value) - partialResult.append(item) - } - - neisRequest(key: "schoolInfo", parameters: parameters, completion: completion) - } -} diff --git a/Sources/NeiSwift/Public/SchoolInfo/SchoolInfoFetchable+default.swift b/Sources/NeiSwift/Public/SchoolInfo/SchoolInfoFetchable+default.swift deleted file mode 100644 index faba2d8..0000000 --- a/Sources/NeiSwift/Public/SchoolInfo/SchoolInfoFetchable+default.swift +++ /dev/null @@ -1,63 +0,0 @@ -import Combine -import Foundation - -public extension SchoolInfoFetchable { - /** - 학교 기본정보에 대한 학교명, 소재지, 주소, 전화번호, 홈페이지주소, 남녀공학여부, 주야구분, 개교기념일 등을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: (Optional) 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - SCHUL_NM: (Optional) 학교명 - - SCHUL_KND_SC_NM: (Optional) 학교 종류명 - - LCTN_SC_NM: (Optional) 소재지명 - - FOND_SC_NM: (Optional) 설립명 - - completion: `Result<[SchoolInfoResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchSchoolList( - key: String, - completion: @escaping (Result<[SchoolInfoResponse], Error>) -> Void - ) { - self.fetchSchoolList( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: nil, - SD_SCHUL_CODE: nil, - SCHUL_NM: nil, - SCHUL_KND_SC_NM: nil, - LCTN_SC_NM: nil, - FOND_SC_NM: nil, - completion: completion - ) - } - - func fetchSchoolList( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String? = nil, - SD_SCHUL_CODE: String? = nil, - SCHUL_NM: String? = nil, - SCHUL_KND_SC_NM: String? = nil, - LCTN_SC_NM: String? = nil, - FOND_SC_NM: String? = nil, - completion: @escaping (Result<[SchoolInfoResponse], Error>) -> Void - ) { - self.fetchSchoolList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - SCHUL_NM: SCHUL_NM, - SCHUL_KND_SC_NM: SCHUL_KND_SC_NM, - LCTN_SC_NM: LCTN_SC_NM, - FOND_SC_NM: FOND_SC_NM, - completion: completion - ) - } -} diff --git a/Sources/NeiSwift/Public/SchoolInfo/SchoolInfoFetchable.swift b/Sources/NeiSwift/Public/SchoolInfo/SchoolInfoFetchable.swift deleted file mode 100644 index 7af3188..0000000 --- a/Sources/NeiSwift/Public/SchoolInfo/SchoolInfoFetchable.swift +++ /dev/null @@ -1,32 +0,0 @@ -import Combine -import Foundation - -public protocol SchoolInfoFetchable { - /** - 학교 기본정보에 대한 학교명, 소재지, 주소, 전화번호, 홈페이지주소, 남녀공학여부, 주야구분, 개교기념일 등을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: (Optional) 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - SCHUL_NM: (Optional) 학교명 - - SCHUL_KND_SC_NM: (Optional) 학교 종류명 - - LCTN_SC_NM: (Optional) 소재지명 - - FOND_SC_NM: (Optional) 설립명 - - completion: `Result<[SchoolInfoResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchSchoolList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String?, - SD_SCHUL_CODE: String?, - SCHUL_NM: String?, - SCHUL_KND_SC_NM: String?, - LCTN_SC_NM: String?, - FOND_SC_NM: String?, - completion: @escaping (Result<[SchoolInfoResponse], Error>) -> Void - ) -} diff --git a/Sources/NeiSwift/Public/SchulAflcoinfo/SchulAflcoinfoFetchable+Neis.swift b/Sources/NeiSwift/Public/SchulAflcoinfo/SchulAflcoinfoFetchable+Neis.swift deleted file mode 100644 index c38ac3e..0000000 --- a/Sources/NeiSwift/Public/SchulAflcoinfo/SchulAflcoinfoFetchable+Neis.swift +++ /dev/null @@ -1,31 +0,0 @@ -import Combine -import Foundation - -public extension SchulAflcoinfoFetchable where Self: NeisRequestable { - func fetchSchulAflcoinfoList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String?, - DGHT_CRSE_SC_NM: String?, - completion: @escaping (Result<[SchulAflcoinfoResponse], Error>) -> Void - ) { - let parameters: [URLQueryItem] = [ - "KEY": key, - "Type": "json", - "pIndex": "\(pIndex)", - "pSize": "\(pSize)", - "ATPT_OFCDC_SC_CODE": ATPT_OFCDC_SC_CODE, - "SD_SCHUL_CODE": SD_SCHUL_CODE, - "DGHT_CRSE_SC_NM": DGHT_CRSE_SC_NM - ] - .reduce(into: [URLQueryItem]()) { partialResult, dict in - guard let value = dict.value else { return } - let item = URLQueryItem(name: dict.key, value: value) - partialResult.append(item) - } - - neisRequest(key: "schulAflcoinfo", parameters: parameters, completion: completion) - } -} diff --git a/Sources/NeiSwift/Public/SchulAflcoinfo/SchulAflcoinfoFetchable+default.swift b/Sources/NeiSwift/Public/SchulAflcoinfo/SchulAflcoinfoFetchable+default.swift deleted file mode 100644 index 3fee4ca..0000000 --- a/Sources/NeiSwift/Public/SchulAflcoinfo/SchulAflcoinfoFetchable+default.swift +++ /dev/null @@ -1,52 +0,0 @@ -import Combine -import Foundation - -public extension SchulAflcoinfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 학교계열정보를 검색할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - completion: `Result<[SchulAflcoinfoResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchSchulAflcoinfoList( - key: String, - ATPT_OFCDC_SC_CODE: String, - completion: @escaping (Result<[SchulAflcoinfoResponse], Error>) -> Void - ) { - self.fetchSchulAflcoinfoList( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: nil, - DGHT_CRSE_SC_NM: nil, - completion: completion - ) - } - - func fetchSchulAflcoinfoList( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, /// 시도교육청코드 - SD_SCHUL_CODE: String? = nil, /// 표준학교코드 - DGHT_CRSE_SC_NM: String? = nil, /// 주야과정명 - completion: @escaping (Result<[SchulAflcoinfoResponse], Error>) -> Void - ) { - self.fetchSchulAflcoinfoList( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - completion: completion - ) - } -} diff --git a/Sources/NeiSwift/Public/SchulAflcoinfo/SchulAflcoinfoFetchable.swift b/Sources/NeiSwift/Public/SchulAflcoinfo/SchulAflcoinfoFetchable.swift deleted file mode 100644 index 9562c6f..0000000 --- a/Sources/NeiSwift/Public/SchulAflcoinfo/SchulAflcoinfoFetchable.swift +++ /dev/null @@ -1,26 +0,0 @@ -import Combine -import Foundation - -public protocol SchulAflcoinfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 학교계열정보를 검색할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: (Optional) 표준학교코드 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - completion: `Result<[SchulAflcoinfoResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchSchulAflcoinfoList( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String?, - DGHT_CRSE_SC_NM: String?, - completion: @escaping (Result<[SchulAflcoinfoResponse], Error>) -> Void - ) -} diff --git a/Sources/NeiSwift/Public/SpsTimeTable/SpsTimeTableFetchable+Neis.swift b/Sources/NeiSwift/Public/SpsTimeTable/SpsTimeTableFetchable+Neis.swift deleted file mode 100644 index 410a224..0000000 --- a/Sources/NeiSwift/Public/SpsTimeTable/SpsTimeTableFetchable+Neis.swift +++ /dev/null @@ -1,49 +0,0 @@ -import Combine -import Foundation - -public extension SpsTimeTableFetchable where Self: NeisRequestable { - func fetchSpsTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - SCHUL_CRSE_SC_NM: String?, - GRADE: String?, - CLRM_NM: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String?, - completion: @escaping (Result<[SpsTimeTableResponse], Error>) -> Void - ) { - let parameters: [URLQueryItem] = [ - "KEY": key, - "Type": "json", - "pIndex": "\(pIndex)", - "pSize": "\(pSize)", - "ATPT_OFCDC_SC_CODE": ATPT_OFCDC_SC_CODE, - "SD_SCHUL_CODE": SD_SCHUL_CODE, - "AY": AY, - "SEM": SEM, - "ALL_TI_YMD": ALL_TI_YMD, - "SCHUL_CRSE_SC_NM": SCHUL_CRSE_SC_NM, - "GRADE": GRADE, - "CLRM_NM": CLRM_NM, - "CLASS_NM": CLASS_NM, - "PERIO": PERIO, - "TI_FROM_YMD": TI_FROM_YMD, - "TI_TO_YMD": TI_TO_YMD - ] - .reduce(into: [URLQueryItem]()) { partialResult, dict in - guard let value = dict.value else { return } - let item = URLQueryItem(name: dict.key, value: value) - partialResult.append(item) - } - - neisRequest(key: "spsTimetable", parameters: parameters, completion: completion) - } -} diff --git a/Sources/NeiSwift/Public/SpsTimeTable/SpsTimeTableFetchable+default.swift b/Sources/NeiSwift/Public/SpsTimeTable/SpsTimeTableFetchable+default.swift deleted file mode 100644 index 3002069..0000000 --- a/Sources/NeiSwift/Public/SpsTimeTable/SpsTimeTableFetchable+default.swift +++ /dev/null @@ -1,89 +0,0 @@ -import Combine -import Foundation - -public extension SpsTimeTableFetchable { - /** - 특수학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 - - GRADE: (Optional) 학년 - - CLRM_NM: (Optional) 강의실명 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - completion: `Result<[SpsTimeTableResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchSpsTimeTable( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - completion: @escaping (Result<[SpsTimeTableResponse], Error>) -> Void - ) { - fetchSpsTimeTable( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - SEM: nil, - ALL_TI_YMD: nil, - SCHUL_CRSE_SC_NM: nil, - GRADE: nil, - CLRM_NM: nil, - CLASS_NM: nil, - PERIO: nil, - TI_FROM_YMD: nil, - TI_TO_YMD: nil, - completion: completion - ) - } - - func fetchSpsTimeTable( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - SEM: String? = nil, - ALL_TI_YMD: String? = nil, - SCHUL_CRSE_SC_NM: String? = nil, - GRADE: String? = nil, - CLRM_NM: String? = nil, - CLASS_NM: String? = nil, - PERIO: String? = nil, - TI_FROM_YMD: String? = nil, - TI_TO_YMD: String? = nil, - completion: @escaping (Result<[SpsTimeTableResponse], Error>) -> Void - ) { - fetchSpsTimeTable( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - SEM: SEM, - ALL_TI_YMD: ALL_TI_YMD, - SCHUL_CRSE_SC_NM: SCHUL_CRSE_SC_NM, - GRADE: GRADE, - CLRM_NM: CLRM_NM, - CLASS_NM: CLASS_NM, - PERIO: PERIO, - TI_FROM_YMD: TI_FROM_YMD, - TI_TO_YMD: TI_TO_YMD, - completion: completion - ) - } -} diff --git a/Sources/NeiSwift/Public/SpsTimeTable/SpsTimeTableFetchable.swift b/Sources/NeiSwift/Public/SpsTimeTable/SpsTimeTableFetchable.swift deleted file mode 100644 index 015eeab..0000000 --- a/Sources/NeiSwift/Public/SpsTimeTable/SpsTimeTableFetchable.swift +++ /dev/null @@ -1,44 +0,0 @@ -import Combine -import Foundation - -public protocol SpsTimeTableFetchable { - /** - 특수학교 학년도, 학교, 학기, 학년, 반, 교시별 시간표 수업내용을 확인할 수 있는 현황입니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 위치 - - pSize: 페이지 당 신청 숫자 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 표준학교코드 - - AY: (Optional) 학년도 - - SEM: (Optional) 학기 - - ALL_TI_YMD: (Optional) 시간표일자 - - SCHUL_CRSE_SC_NM: (Optional) 학교과정명 - - GRADE: (Optional) 학년 - - CLRM_NM: (Optional) 강의실명 - - CLASS_NM: (Optional) 반명 - - PERIO: (Optional) 교시 - - TI_FROM_YMD: (Optional) 시간표시작일자 - - TI_TO_YMD: (Optional) 시간표종료일자 - - completion: `Result<[SpsTimeTableResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchSpsTimeTable( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - SEM: String?, - ALL_TI_YMD: String?, - SCHUL_CRSE_SC_NM: String?, - GRADE: String?, - CLRM_NM: String?, - CLASS_NM: String?, - PERIO: String?, - TI_FROM_YMD: String?, - TI_TO_YMD: String?, - completion: @escaping (Result<[SpsTimeTableResponse], Error>) -> Void - ) -} diff --git a/Sources/NeiSwift/Public/TimeTableClassRoomInfo/TimeTableClassRoomInfoFetchable+Neis.swift b/Sources/NeiSwift/Public/TimeTableClassRoomInfo/TimeTableClassRoomInfoFetchable+Neis.swift deleted file mode 100644 index c44e7b7..0000000 --- a/Sources/NeiSwift/Public/TimeTableClassRoomInfo/TimeTableClassRoomInfoFetchable+Neis.swift +++ /dev/null @@ -1,43 +0,0 @@ -import Combine -import Foundation - -public extension TimeTableClassRoomInfoFetchable where Self: NeisRequestable { - func fetchTimeTableClassRoom( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - GRADE: String?, - SEM: String?, - SCHUL_CRSE_SC_NM: String?, - DGHT_CRSE_SC_NM: String?, - ORD_SC_NM: String?, - DDDEP_NM: String?, - completion: @escaping (Result<[TimeTableClassRoomInfoResponse], Error>) -> Void - ) { - let parameters: [URLQueryItem] = [ - "KEY": key, - "Type": "json", - "pIndex": "\(pIndex)", - "pSize": "\(pSize)", - "ATPT_OFCDC_SC_CODE": ATPT_OFCDC_SC_CODE, - "SD_SCHUL_CODE": SD_SCHUL_CODE, - "AY": AY, - "GRADE": GRADE, - "SEM": SEM, - "SCHUL_CRSE_SC_NM": SCHUL_CRSE_SC_NM, - "DGHT_CRSE_SC_NM": DGHT_CRSE_SC_NM, - "ORD_SC_NM": ORD_SC_NM, - "DDDEP_NM": DDDEP_NM - ] - .reduce(into: [URLQueryItem]()) { partialResult, dict in - guard let value = dict.value else { return } - let item = URLQueryItem(name: dict.key, value: value) - partialResult.append(item) - } - - neisRequest(key: "tiClrminfo", parameters: parameters, completion: completion) - } -} diff --git a/Sources/NeiSwift/Public/TimeTableClassRoomInfo/TimeTableClassRoomInfoFetchable+default.swift b/Sources/NeiSwift/Public/TimeTableClassRoomInfo/TimeTableClassRoomInfoFetchable+default.swift deleted file mode 100644 index ab5e809..0000000 --- a/Sources/NeiSwift/Public/TimeTableClassRoomInfo/TimeTableClassRoomInfoFetchable+default.swift +++ /dev/null @@ -1,77 +0,0 @@ -import Combine -import Foundation - -public extension TimeTableClassRoomInfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 시간표강의실 정보를 검색 할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 번호 - - pSize: 한 페이지 결과 수 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 학교코드 - - AY: (Optional) 학년도 - - GRADE: (Optional) 학년 - - SEM: (Optional) 학기 - - SCHUL_CRSE_SC_NM: (Optional) 학교종류명 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - ORD_SC_NM: (Optional) 계열명 - - DDDEP_NM: (Optional) 학과명 - - completion: `Result<[TimeTableClassRoomInfoResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchTimeTableClassRoom( - key: String, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - completion: @escaping (Result<[TimeTableClassRoomInfoResponse], Error>) -> Void - ) { - self.fetchTimeTableClassRoom( - key: key, - pIndex: 1, - pSize: 100, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: nil, - GRADE: nil, - SEM: nil, - SCHUL_CRSE_SC_NM: nil, - DGHT_CRSE_SC_NM: nil, - ORD_SC_NM: nil, - DDDEP_NM: nil, - completion: completion - ) - } - - func fetchTimeTableClassRoom( - key: String, - pIndex: Int = 1, - pSize: Int = 100, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String? = nil, - GRADE: String? = nil, - SEM: String? = nil, - SCHUL_CRSE_SC_NM: String? = nil, - DGHT_CRSE_SC_NM: String? = nil, - ORD_SC_NM: String? = nil, - DDDEP_NM: String? = nil, - completion: @escaping (Result<[TimeTableClassRoomInfoResponse], Error>) -> Void - ) { - self.fetchTimeTableClassRoom( - key: key, - pIndex: pIndex, - pSize: pSize, - ATPT_OFCDC_SC_CODE: ATPT_OFCDC_SC_CODE, - SD_SCHUL_CODE: SD_SCHUL_CODE, - AY: AY, - GRADE: GRADE, - SEM: SEM, - SCHUL_CRSE_SC_NM: SCHUL_CRSE_SC_NM, - DGHT_CRSE_SC_NM: DGHT_CRSE_SC_NM, - ORD_SC_NM: ORD_SC_NM, - DDDEP_NM: DDDEP_NM, - completion: completion - ) - } -} diff --git a/Sources/NeiSwift/Public/TimeTableClassRoomInfo/TimeTableClassRoomInfoFetchable.swift b/Sources/NeiSwift/Public/TimeTableClassRoomInfo/TimeTableClassRoomInfoFetchable.swift deleted file mode 100644 index e277fcc..0000000 --- a/Sources/NeiSwift/Public/TimeTableClassRoomInfo/TimeTableClassRoomInfoFetchable.swift +++ /dev/null @@ -1,38 +0,0 @@ -import Combine -import Foundation - -public protocol TimeTableClassRoomInfoFetchable { - /** - 학교명 등의 검색 조건을 선택하여 시간표강의실 정보를 검색 할 수 있습니다. - - - Parameters: - - key: 인증키 - - pIndex: 페이지 번호 - - pSize: 한 페이지 결과 수 - - ATPT_OFCDC_SC_CODE: 시도교육청코드 - - SD_SCHUL_CODE: 학교코드 - - AY: (Optional) 학년도 - - GRADE: (Optional) 학년 - - SEM: (Optional) 학기 - - SCHUL_CRSE_SC_NM: (Optional) 학교종류명 - - DGHT_CRSE_SC_NM: (Optional) 주야과정명 - - ORD_SC_NM: (Optional) 계열명 - - DDDEP_NM: (Optional) 학과명 - - completion: `Result<[TimeTableClassRoomInfoResponse], Error>`를 사용할 수 있는 클로저 - */ - func fetchTimeTableClassRoom( - key: String, - pIndex: Int, - pSize: Int, - ATPT_OFCDC_SC_CODE: String, - SD_SCHUL_CODE: String, - AY: String?, - GRADE: String?, - SEM: String?, - SCHUL_CRSE_SC_NM: String?, - DGHT_CRSE_SC_NM: String?, - ORD_SC_NM: String?, - DDDEP_NM: String?, - completion: @escaping (Result<[TimeTableClassRoomInfoResponse], Error>) -> Void - ) -}