Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed IdWrapper creation to match schema change #20

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion parser/courseParser.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func parseCourse(courseNum string, session schema.AcademicSession, rowInfo map[s

course = &schema.Course{}

course.Id = schema.IdWrapper{ObjectID: primitive.NewObjectID()}
course.Id = schema.IdWrapper(primitive.NewObjectID().Hex())
course.Course_number = idMatches[2]
course.Subject_prefix = idMatches[1]
course.Title = rowInfo["Course Title:"]
Expand Down
2 changes: 1 addition & 1 deletion parser/professorParser.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func parseProfessors(sectionId schema.IdWrapper, rowInfo map[string]string, clas
}

prof = &schema.Professor{}
prof.Id = schema.IdWrapper{ObjectID: primitive.NewObjectID()}
prof.Id = schema.IdWrapper(primitive.NewObjectID().Hex())
prof.First_name = firstName
prof.Last_name = lastName
prof.Titles = []string{match[2]}
Expand Down
2 changes: 1 addition & 1 deletion parser/sectionParser.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func parseSection(courseRef *schema.Course, classNum string, syllabusURI string,

section := &schema.Section{}

section.Id = schema.IdWrapper{ObjectID: primitive.NewObjectID()}
section.Id = schema.IdWrapper(primitive.NewObjectID().Hex())
section.Section_number = idMatches[1]
section.Course_reference = courseRef.Id

Expand Down
2 changes: 1 addition & 1 deletion scrapers/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func ScrapeEvents(outDir string) {
log.Printf("Scraped contact phone info: %s\n", contactInformationPhone)

events = append(events, schema.Event{
Id: schema.IdWrapper{ObjectID: primitive.NewObjectID()},
Id: schema.IdWrapper(primitive.NewObjectID().Hex()),
Summary: summary,
Location: location,
StartTime: dateTimeStart,
Expand Down
2 changes: 1 addition & 1 deletion scrapers/organizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func parseCsvRecord(ctx context.Context, entry []string) (*schema.Organization,
log.Printf("Error retrieving image for %s: %v\n", entry[0], err)
}
return &schema.Organization{
Id: schema.IdWrapper{ObjectID: primitive.NewObjectID()},
Id: schema.IdWrapper(primitive.NewObjectID().Hex()),
Title: entry[0],
Categories: parseCategories(entry[1]),
Description: entry[2],
Expand Down
2 changes: 1 addition & 1 deletion scrapers/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func ScrapeProfiles(outDir string) {
log.Printf("Parsed list! #: %s, Office: %v\n\n", phoneNumber, office)

professors = append(professors, schema.Professor{
Id: schema.IdWrapper{ObjectID: primitive.NewObjectID()},
Id: schema.IdWrapper(primitive.NewObjectID().Hex()),
First_name: firstName,
Last_name: lastName,
Titles: titles,
Expand Down