-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
644 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export interface CommonSubject { | ||
code: string; | ||
name: string; | ||
} | ||
|
||
function parseCommonSubject(data: any): CommonSubject { | ||
return { | ||
code: data.code, | ||
name: data.codeName1, | ||
}; | ||
} | ||
|
||
/** | ||
* 광운대학교의 공통 과목 목록을 가져옵니다. | ||
*/ | ||
export async function fetchCommonSubjects(): Promise<CommonSubject[]> { | ||
const response = await fetch('/std/cps/atnlc/CmmnGamokList.do', { | ||
method: 'POST', | ||
headers: { | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/json', | ||
}, | ||
body: '{}', | ||
}); | ||
|
||
if (!response.ok) { | ||
throw new Error(`Failed to fetch common subjects. Status: ${response.status}`); | ||
} | ||
|
||
return (await response.json()).map(parseCommonSubject); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
export interface Department { | ||
code: string; | ||
name: string; | ||
} | ||
|
||
export interface FetchDepartmentsRequestData { | ||
year: number | string; | ||
semester: string; | ||
} | ||
|
||
function parseDepartment(data: any): Department { | ||
return { | ||
code: data.classCode, | ||
name: data.openMajorName, | ||
}; | ||
} | ||
|
||
/** | ||
* 광운대학교의 학과 목록을 가져옵니다. | ||
*/ | ||
export async function fetchDepartments(requestData: FetchDepartmentsRequestData): Promise<Department[]> { | ||
const response = await fetch('/std/cps/atnlc/CmmnHakgwaList.do', { | ||
method: 'POST', | ||
headers: { | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/json', | ||
}, | ||
body: JSON.stringify({ | ||
selectYear: requestData.year, | ||
selecthakgi: requestData.semester, | ||
}), | ||
}); | ||
|
||
if (!response.ok) { | ||
throw new Error(`Failed to fetch departments. Status: ${response.status}`); | ||
} | ||
|
||
return (await response.json()).map(parseDepartment); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
export interface Lecture { | ||
year: string; | ||
semester: string; | ||
majorCode: string; | ||
grade: string; | ||
code: string; | ||
classNumber: string; | ||
name: string; | ||
professorName: string; | ||
classification: string; | ||
classHours: number; | ||
credits: number; | ||
contact: string; | ||
description: string; | ||
isClosed: boolean; | ||
introVideoUrl: string; | ||
} | ||
|
||
export interface FetchLecturesRequestData { | ||
year: number | string; | ||
semester: string; | ||
enrollmentStatus: string; | ||
lectureName?: string; | ||
professorName?: string; | ||
commonSubjectCode?: string; | ||
departmentCode?: string; | ||
majorCode?: string; | ||
} | ||
|
||
function parseLecture(data: any): Lecture { | ||
return { | ||
year: data.thisYear, | ||
semester: data.hakgi, | ||
majorCode: data.openMajorCode, | ||
grade: data.openGrade, | ||
code: data.openGwamokNo, | ||
classNumber: data.bunbanNo, | ||
name: data.gwamokKname, | ||
professorName: data.memberName, | ||
classification: data.codeName1, | ||
classHours: data.sisuNum, | ||
credits: data.hakjumNum, | ||
contact: data.telNo ?? '', | ||
description: data.summary ?? '', | ||
isClosed: Boolean(data.closeOpt), | ||
introVideoUrl: data.videoUrl ?? '', | ||
}; | ||
} | ||
|
||
/** | ||
* 광운대학교의 강의 목록을 가져옵니다. | ||
*/ | ||
export async function fetchLectures(requestData: FetchLecturesRequestData): Promise<Lecture[]> { | ||
const response = await fetch('/std/cps/atnlc/LectrePlanStdList.do', { | ||
method: 'POST', | ||
headers: { | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/json', | ||
}, | ||
body: JSON.stringify({ | ||
selectYear: requestData.year, | ||
selecthakgi: requestData.semester, | ||
selectRadio: requestData.enrollmentStatus, | ||
selectText: requestData.lectureName ?? '', | ||
selectProfsr: requestData.professorName ?? '', | ||
cmmnGamok: requestData.commonSubjectCode ?? '', | ||
selecthakgwa: requestData.departmentCode ?? '', | ||
selectMajor: requestData.majorCode ?? '', | ||
}), | ||
}); | ||
|
||
if (!response.ok) { | ||
throw new Error(`Failed to fetch lectures. Status: ${response.status}`); | ||
} | ||
|
||
return (await response.json()).map(parseLecture); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
export interface Major { | ||
code: string; | ||
name: string; | ||
} | ||
|
||
export interface FetchMajorsRequestData { | ||
year: number | string; | ||
semester: string; | ||
departmentCode: string; | ||
} | ||
|
||
function parseMajor(data: any): Major { | ||
return { | ||
code: data.code, | ||
name: data.codeName1, | ||
}; | ||
} | ||
|
||
/** | ||
* 광운대학교의 전공 목록을 가져옵니다. | ||
*/ | ||
export async function fetchMajors(requestData: FetchMajorsRequestData): Promise<Major[]> { | ||
const response = await fetch('/std/cps/atnlc/CmmnMagerCodeList.do', { | ||
method: 'POST', | ||
headers: { | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/json', | ||
}, | ||
body: JSON.stringify({ | ||
selectYear: requestData.year, | ||
selecthakgi: requestData.semester, | ||
selecthakgwa: requestData.departmentCode, | ||
}), | ||
}); | ||
|
||
if (!response.ok) { | ||
throw new Error(`Failed to fetch majors. Status: ${response.status}`); | ||
} | ||
|
||
return (await response.json()).map(parseMajor); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from './fetchCommonSubjects'; | ||
export * from './fetchDepartments'; | ||
export * from './fetchLectures'; | ||
export * from './fetchMajors'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
.helper-form { | ||
.helper-title { | ||
margin-bottom: 4px; | ||
font-weight: bold; | ||
} | ||
|
||
.helper-control { | ||
display: flex; | ||
align-items: center; | ||
gap: 4px; | ||
height: 32px; | ||
} | ||
} | ||
|
||
.helper-table { | ||
th { | ||
white-space: pre-line; | ||
} | ||
|
||
tbody { | ||
tr.ant-table-row { | ||
cursor: pointer; | ||
} | ||
|
||
td { | ||
font-weight: normal; | ||
} | ||
} | ||
|
||
.helper-missing { | ||
background-color: #f5f5f5; | ||
color: gray; | ||
} | ||
|
||
.helper-closed { | ||
background-color: #fef2f2; | ||
color: red; | ||
} | ||
|
||
.helper-rate { | ||
font-size: 14px; | ||
|
||
li { | ||
margin: 0 !important; | ||
cursor: pointer !important; | ||
} | ||
} | ||
} |
Oops, something went wrong.