Add comments to various SearchResult attributes, add SectionAttributes, fix Faculty

This commit is contained in:
2024-01-28 04:24:06 -06:00
parent dcf51986a7
commit 0fb7ab3e0d

View File

@@ -91,6 +91,7 @@ func (m *MeetingTimeResponse) TimeString() string {
return fmt.Sprintf("%s %s-%s", WeekdaysToString(m.Days()), m.StartTime().String(), m.EndTime().String()) return fmt.Sprintf("%s %s-%s", WeekdaysToString(m.Days()), m.StartTime().String(), m.EndTime().String())
} }
// PlaceString returns a formatted string best representing the place of the meeting time
func (m *MeetingTimeResponse) PlaceString() string { func (m *MeetingTimeResponse) PlaceString() string {
if m.MeetingTime.Room == "" { if m.MeetingTime.Room == "" {
return "???" return "???"
@@ -177,39 +178,62 @@ type SearchResult struct {
Display string `json:"display"` Display string `json:"display"`
} `json:"searchResultsConfig"` } `json:"searchResultsConfig"`
Data []struct { Data []struct {
Id int `json:"id"` // A internal identifier not used outside of the Banner system
Term string `json:"term"` Id int `json:"id"`
TermDesc string `json:"termDesc"` // The internal identifier for the term this class is in (e.g. 202420)
CourseReferenceNumber string `json:"courseReferenceNumber"` Term string `json:"term"`
PartOfTerm string `json:"partOfTerm"` // The human-readable name of the term this class is in (e.g. Fall 2021)
CourseNumber string `json:"courseNumber"` TermDesc string `json:"termDesc"`
Subject string `json:"subject"` // The specific identifier that describes this individual course. CRNs are unique to a term. (TODO: Verify this is true)
SubjectDescription string `json:"subjectDescription"` CourseReferenceNumber string `json:"courseReferenceNumber"`
SequenceNumber string `json:"sequenceNumber"` PartOfTerm string `json:"partOfTerm"`
CampusDescription string `json:"campusDescription"` CourseNumber string `json:"courseNumber"`
ScheduleTypeDescription string `json:"scheduleTypeDescription"` // The short acronym of the course subject (e.g. CS, AEPI)
CourseTitle string `json:"courseTitle"` Subject string `json:"subject"`
CreditHours int `json:"creditHours"` // The full name of the course subject (e.g. Computer Science, Academic English Program-Intl.)
MaximumEnrollment int `json:"maximumEnrollment"` SubjectDescription string `json:"subjectDescription"`
Enrollment int `json:"enrollment"` // The specific section of the course (e.g. 001, 002)
SeatsAvailable int `json:"seatsAvailable"` SequenceNumber string `json:"sequenceNumber"`
WaitCapacity int `json:"waitCapacity"` // The long name of the campus this course takes place at (e.g. Main Campus, Downtown Campus)
WaitCount int `json:"waitCount"` CampusDescription string `json:"campusDescription"`
CrossList *string `json:"crossList"` ScheduleTypeDescription string `json:"scheduleTypeDescription"`
CrossListCapacity *int `json:"crossListCapacity"` // The long name of the course (generally)
CrossListCount *int `json:"crossListCount"` CourseTitle string `json:"courseTitle"`
CrossListAvailable *int `json:"crossListAvailable"` CreditHours int `json:"creditHours"`
CreditHourHigh *int `json:"creditHourHigh"` // The maximum number of students that can enroll in this course
CreditHourLow *int `json:"creditHourLow"` MaximumEnrollment int `json:"maximumEnrollment"`
CreditHourIndicator *string `json:"creditHourIndicator"` // The number of students currently enrolled in this course
OpenSection bool `json:"openSection"` Enrollment int `json:"enrollment"`
LinkIdentifier *string `json:"linkIdentifier"` // The number of seats available in this course (MaximumEnrollment - Enrollment)
IsSectionLinked bool `json:"isSectionLinked"` SeatsAvailable int `json:"seatsAvailable"`
// The number of students that could waitlist for this course
WaitCapacity int `json:"waitCapacity"`
// The number of students currently on the waitlist for this course
WaitCount int `json:"waitCount"`
CrossList *string `json:"crossList"`
CrossListCapacity *int `json:"crossListCapacity"`
CrossListCount *int `json:"crossListCount"`
CrossListAvailable *int `json:"crossListAvailable"`
CreditHourHigh *int `json:"creditHourHigh"`
CreditHourLow *int `json:"creditHourLow"`
CreditHourIndicator *string `json:"creditHourIndicator"`
OpenSection bool `json:"openSection"`
LinkIdentifier *string `json:"linkIdentifier"`
IsSectionLinked bool `json:"isSectionLinked"`
// A combination of the subject and course number (e.g. subject=CS, courseNumber=3443 => "CS3443")
SubjectCourse string `json:"subjectCourse"` SubjectCourse string `json:"subjectCourse"`
ReservedSeatSummary *string `json:"reservedSeatSummary"` ReservedSeatSummary *string `json:"reservedSeatSummary"`
InstructionalMethod string `json:"instructionalMethod"` InstructionalMethod string `json:"instructionalMethod"`
InstructionalMethodDescription string `json:"instructionalMethodDescription"` InstructionalMethodDescription string `json:"instructionalMethodDescription"`
Faculty []FacultyItem SectionAttributes []struct {
MeetingsFaculty []MeetingTimeResponse `json:"meetingsFaculty"` Class string `json:"class"`
Code string `json:"code"`
CourseReferenceNumber string `json:"courseReferenceNumber"`
Description string `json:"description"`
IsZtcAttribute bool `json:"isZTCAttribute"`
TermCode string `json:"termCode"`
} `json:"sectionAttributes"`
Faculty []FacultyItem `json:"faculty"`
MeetingsFaculty []MeetingTimeResponse `json:"meetingsFaculty"`
} `json:"data"` } `json:"data"`
} }