Skip to content

Commit 430c706

Browse files
authored
Merge pull request #269 from UTDNebula/tag-grouping
Tag grouping
2 parents eea5237 + 53b9cf4 commit 430c706

File tree

13 files changed

+246
-0
lines changed

13 files changed

+246
-0
lines changed

api/controllers/astra.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var astraCollection *mongo.Collection = configs.GetCollection("astra")
1919

2020
// @Id AstraEvents
2121
// @Router /astra/{date} [get]
22+
// @Tags Events
2223
// @Description "Returns AstraEvent based on the input date"
2324
// @Produce json
2425
// @Param date path string true "date (ISO format) to retrieve astra events"

api/controllers/autocomplete.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var DAGCollection *mongo.Collection = configs.GetCollection("DAG")
1919

2020
// @Id autocompleteDAG
2121
// @Router /autocomplete/dag [get]
22+
// @Tags Other
2223
// @Description "Returns an aggregation of courses for use in generating autocomplete DAGs"
2324
// @Produce json
2425
// @Success 200 {object} schema.APIResponse[[]schema.Autocomplete] "An aggregation of courses for use in generating autocomplete DAGs"

api/controllers/course.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var courseCollection *mongo.Collection = configs.GetCollection("courses")
2020

2121
// @Id courseSearch
2222
// @Router /course [get]
23+
// @Tags Courses
2324
// @Description "Returns paginated list of courses matching the query's string-typed key-value pairs. See offset for more details on pagination."
2425
// @Produce json
2526
// @Param offset query number false "The starting position of the current page of courses (e.g. For starting at the 17th course, offset=16)."
@@ -79,6 +80,7 @@ func CourseSearch(c *gin.Context) {
7980

8081
// @Id courseById
8182
// @Router /course/{id} [get]
83+
// @Tags Courses
8284
// @Description "Returns the course with given ID"
8385
// @Produce json
8486
// @Param id path string true "ID of the course to get"
@@ -109,6 +111,7 @@ func CourseById(c *gin.Context) {
109111

110112
// @Id courseAll
111113
// @Router /course/all [get]
114+
// @Tags Courses
112115
// @Description "Returns all courses"
113116
// @Produce json
114117
// @Success 200 {object} schema.APIResponse[[]schema.Course] "All courses"
@@ -139,6 +142,7 @@ func CourseAll(c *gin.Context) {
139142

140143
// @Id courseSectionSearch
141144
// @Router /course/sections [get]
145+
// @Tags Courses
142146
// @Description "Returns paginated list of sections of all the courses matching the query's string-typed key-value pairs. See former_offset and latter_offset for pagination details."
143147
// @Produce json
144148
// @Param former_offset query number false "The starting position of the current page of courses (e.g. For starting at the 17th course, former_offset=16)."
@@ -166,6 +170,7 @@ func CourseSectionSearch() gin.HandlerFunc {
166170

167171
// @Id courseSectionById
168172
// @Router /course/{id}/sections [get]
173+
// @Tags Courses
169174
// @Description "Returns the all of the sections of the course with given ID"
170175
// @Produce json
171176
// @Param id path string true "ID of the course to get"
@@ -248,6 +253,7 @@ func courseSection(flag string, c *gin.Context) {
248253

249254
// @Id courseProfessorSearch
250255
// @Router /course/professors [get]
256+
// @Tags Courses
251257
// @Description "Returns paginated list of professors of all the courses matching the query's string-typed key-value pairs. See former_offset and latter_offset for pagination details."
252258
// @Produce json
253259
// @Param former_offset query number false "The starting position of the current page of courses (e.g. For starting at the 17th course, former_offset=16)."
@@ -273,6 +279,7 @@ func CourseProfessorSearch(c *gin.Context) {
273279

274280
// @Id courseProfessorById
275281
// @Router /course/{id}/professors [get]
282+
// @Tags Courses
276283
// @Description "Returns the all of the professors of the course with given ID"
277284
// @Produce json
278285
// @Param id path string true "ID of the course to get"
@@ -394,6 +401,7 @@ func getCourseQuery(flag string, c *gin.Context) (bson.M, error) {
394401

395402
// @Id trendsCourseSectionSearch
396403
// @Router /course/sections/trends [get]
404+
// @Tags Courses
397405
// @Description "Returns all of the given course's sections. Specialized high-speed convenience endpoint for UTD Trends internal use; limited query flexibility."
398406
// @Produce json
399407
// @Param course_number query string true "The course's official number"

api/controllers/events.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var eventsCollection *mongo.Collection = configs.GetCollection("events")
1919

2020
// @Id events
2121
// @Router /events/{date} [get]
22+
// @Tags Events
2223
// @Description "Returns all sections with meetings on the specified date"
2324
// @Produce json
2425
// @Param date path string true "ISO date of the set of events to get"
@@ -45,6 +46,7 @@ func Events(c *gin.Context) {
4546

4647
// @Id eventsByBuilding
4748
// @Router /events/{date}/{building} [get]
49+
// @Tags Events
4850
// @Description "Returns all sections with meetings on the specified date in the specified building"
4951
// @Produce json
5052
// @Param date path string true "ISO date of the set of events to get"

api/controllers/grades.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import (
5353

5454
// @Id gradeAggregationBySemester
5555
// @Router /grades/semester [get]
56+
// @Tags Grades
5657
// @Description "Returns grade distributions aggregated by semester"
5758
// @Produce json
5859
// @Param prefix query string false "The course's subject prefix"
@@ -71,6 +72,7 @@ func GradeAggregationSemester() gin.HandlerFunc {
7172

7273
// @Id gradeAggregationSectionType
7374
// @Router /grades/semester/sectionType [get]
75+
// @Tags Grades
7476
// @Description "Returns the grade distributions aggregated by semester and broken down into section type"
7577
// @Produce json
7678
// @Param prefix query string false "The course's subject prefix"
@@ -89,6 +91,7 @@ func GradesAggregationSectionType() gin.HandlerFunc {
8991

9092
// @Id gradeAggregationOverall
9193
// @Router /grades/overall [get]
94+
// @Tags Grades
9295
// @Description "Returns the overall grade distribution"
9396
// @Produce json
9497
// @Param prefix query string false "The course's subject prefix"
@@ -107,6 +110,7 @@ func GradesAggregationOverall() gin.HandlerFunc {
107110

108111
// @Id GradesByCourseID
109112
// @Router /course/{id}/grades [get]
113+
// @Tags Courses
110114
// @Description "Returns the overall grade distribution for a course"
111115
// @Produce json
112116
// @Param id path string true "ID of course to get grades for"
@@ -121,6 +125,7 @@ func GradesByCourseID() gin.HandlerFunc {
121125

122126
// @Id GradesBySectionID
123127
// @Router /section/{id}/grades [get]
128+
// @Tags Sections
124129
// @Description "Returns the overall grade distribution for a section"
125130
// @Produce json
126131
// @Param id path string true "ID of section to get grades for"
@@ -135,6 +140,7 @@ func GradesBySectionID() gin.HandlerFunc {
135140

136141
// @Id GradesByProfessorID
137142
// @Router /professor/{id}/grades [get]
143+
// @Tags Professors
138144
// @Description "Returns the overall grade distribution for a professor"
139145
// @Produce json
140146
// @Param id path string true "ID of professor to get grades for"

api/controllers/mazevo.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var mazevoCollection *mongo.Collection = configs.GetCollection("mazevo")
1919

2020
// @Id MazevoEvents
2121
// @Router /mazevo/{date} [get]
22+
// @Tags Events
2223
// @Description "Returns MazevoEvent based on the input date"
2324
// @Produce json
2425
// @Param date path string true "date (ISO format) to retrieve mazevo events"

api/controllers/professor.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var professorCollection *mongo.Collection = configs.GetCollection("professors")
2020

2121
// @Id professorSearch
2222
// @Router /professor [get]
23+
// @Tags Professors
2324
// @Description "Returns paginated list of professors matching the query's string-typed key-value pairs. See offset for more details on pagination."
2425
// @Produce json
2526
// @Param offset query number false "The starting position of the current page of professors (e.g. For starting at the 17th professor, offset=16)."
@@ -87,6 +88,7 @@ func ProfessorSearch(c *gin.Context) {
8788

8889
// @Id professorById
8990
// @Router /professor/{id} [get]
91+
// @Tags Professors
9092
// @Description "Returns the professor with given ID"
9193
// @Produce json
9294
// @Param id path string true "ID of the professor to get"
@@ -119,6 +121,7 @@ func ProfessorById(c *gin.Context) {
119121

120122
// @Id professorAll
121123
// @Router /professor/all [get]
124+
// @Tags Professors
122125
// @Description "Returns all professors"
123126
// @Produce json
124127
// @Success 200 {object} schema.APIResponse[[]schema.Professor] "All professors"
@@ -149,6 +152,7 @@ func ProfessorAll(c *gin.Context) {
149152

150153
// @Id professorCourseSearch
151154
// @Router /professor/courses [get]
155+
// @Tags Professors
152156
// @Description "Returns paginated list of the courses of all the professors matching the query's string-typed key-value pairs. See former_offset and latter_offset for pagination details."
153157
// @Produce json
154158
// @Param former_offset query number false "The starting position of the current page of professors (e.g. For starting at the 17th professor, former_offset=16)."
@@ -184,6 +188,7 @@ func ProfessorCourseSearch() gin.HandlerFunc {
184188

185189
// @Id professorCourseById
186190
// @Router /professor/{id}/courses [get]
191+
// @Tags Professors
187192
// @Description "Returns all the courses taught by the professor with given ID"
188193
// @Produce json
189194
// @Param id path string true "ID of the professor to get"
@@ -282,6 +287,7 @@ func professorCourse(flag string, c *gin.Context) {
282287

283288
// @Id professorSectionSearch
284289
// @Router /professor/sections [get]
290+
// @Tags Professors
285291
// @Description "Returns paginated list of the sections of all the professors matching the query's string-typed key-value pairs. See former_offset and latter_offset for pagination details."
286292
// @Produce json
287293
// @Param former_offset query number false "The starting position of the current page of professors (e.g. For starting at the 17th professor, former_offset=16)."
@@ -316,6 +322,7 @@ func ProfessorSectionSearch() gin.HandlerFunc {
316322

317323
// @Id professorSectionById
318324
// @Router /professor/{id}/sections [get]
325+
// @Tags Professors
319326
// @Description "Returns all the sections taught by the professor with given ID"
320327
// @Produce json
321328
// @Param id path string true "ID of the professor to get"
@@ -433,6 +440,7 @@ func getProfessorQuery(flag string, c *gin.Context) (bson.M, error) {
433440

434441
// @Id trendsProfessorSectionSearch
435442
// @Router /professor/sections/trends [get]
443+
// @Tags Professors
436444
// @Description "Returns all of the given professor's sections. Specialized high-speed convenience endpoint for UTD Trends internal use; limited query flexibility."
437445
// @Produce json
438446
// @Param first_name query string true "The professor's first name"

api/controllers/rooms.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var buildingCollection *mongo.Collection = configs.GetCollection("rooms")
1919

2020
// @Id rooms
2121
// @Router /rooms [get]
22+
// @Tags Events
2223
// @Description "Returns all schedulable rooms being used in the current and futures semesters from CourseBook, Astra, and Mazevo"
2324
// @Produce json
2425
// @Success 200 {object} schema.APIResponse[[]schema.BuildingRooms] "All schedulable rooms being used in the current and futures semesters from CourseBook, Astra, and Mazevo"

api/controllers/section.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var sectionCollection *mongo.Collection = configs.GetCollection("sections")
2020

2121
// @Id sectionSearch
2222
// @Router /section [get]
23+
// @Tags Sections
2324
// @Description "Returns paginated list of sections matching the query's string-typed key-value pairs. See offset for more details on pagination."
2425
// @Produce json
2526
// @Param offset query number false "The starting position of the current page of sections (e.g. For starting at the 17th professor, offset=16)."
@@ -89,6 +90,7 @@ func SectionSearch(c *gin.Context) {
8990

9091
// @Id sectionById
9192
// @Router /section/{id} [get]
93+
// @Tags Sections
9294
// @Description "Returns the section with given ID"
9395
// @Produce json
9496
// @Param id path string true "ID of the section to get"
@@ -121,6 +123,7 @@ func SectionById(c *gin.Context) {
121123

122124
// @Id sectionCourseSearch
123125
// @Router /section/courses [get]
126+
// @Tags Sections
124127
// @Description "Returns paginated list of courses of all the sections matching the query's string-typed key-value pairs. See former_offset and latter_offset for pagination details."
125128
// @Produce json
126129
// @Param former_offset query number false "The starting position of the current page of sections (e.g. For starting at the 16th section, former_offset=16)."
@@ -157,6 +160,7 @@ func SectionCourseSearch() gin.HandlerFunc {
157160

158161
// @Id sectionCourseById
159162
// @Router /section/{id}/course [get]
163+
// @Tags Sections
160164
// @Description "Returns the course of the section with given ID"
161165
// @Produce json
162166
// @Param id path string true "ID of the section to get"
@@ -248,6 +252,7 @@ func sectionCourse(flag string, c *gin.Context) {
248252

249253
// @Id sectionProfessorSearch
250254
// @Router /section/professors [get]
255+
// @Tags Sections
251256
// @Description "Returns paginated list of professors of all the sections matching the query's string-typed key-value pairs. See former_offset and latter_offset for pagination details."
252257
// @Produce json
253258
// @Param former_offset query number false "The starting position of the current page of sections (e.g. For starting at the 16th sections, former_offset=16)."
@@ -284,6 +289,7 @@ func SectionProfessorSearch() gin.HandlerFunc {
284289

285290
// @Id sectionProfessorById
286291
// @Router /section/{id}/professors [get]
292+
// @Tags Sections
287293
// @Description "Returns the paginated list of professors of the section with given ID"
288294
// @Produce json
289295
// @Param id path string true "ID of the section to get"

api/controllers/storage.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func getOrCreateBucket(client *storage.Client, bucket string) (*storage.BucketHa
4545

4646
// @Id bucketInfo
4747
// @Router /storage/{bucket} [get]
48+
// @Tags Internal
4849
// @Description "Get info on a bucket. This route is restricted to only Nebula Labs internal Projects."
4950
// @Param bucket path string true "Name of the bucket"
5051
// @Param x-storage-key header string true "The internal storage key"
@@ -92,6 +93,7 @@ func BucketInfo(c *gin.Context) {
9293

9394
// @Id deleteBucket
9495
// @Router /storage/{bucket} [delete]
96+
// @Tags Internal
9597
// @Description "Delete a bucket. This route is restricted to only Nebula Labs internal Projects."
9698
// @Param bucket path string true "Name of the bucket"
9799
// @Param x-storage-key header string true "The internal storage key"
@@ -138,6 +140,7 @@ func DeleteBucket(c *gin.Context) {
138140

139141
// @Id objectInfo
140142
// @Router /storage/{bucket}/{objectID} [get]
143+
// @Tags Internal
141144
// @Description "Get info on an object in a bucket. This route is restricted to only Nebula Labs internal Projects."
142145
// @Param bucket path string true "Name of the bucket"
143146
// @Param objectID path string true "ID of the object"
@@ -175,6 +178,7 @@ func ObjectInfo(c *gin.Context) {
175178

176179
// @Id postObject
177180
// @Router /storage/{bucket}/{objectID} [post]
181+
// @Tags Internal
178182
// @Description "Upload an object to a bucket. This route is restricted to only Nebula Labs internal Projects."
179183
// @Param bucket path string true "Name of the bucket"
180184
// @Param objectID path string true "ID of the object"
@@ -236,6 +240,7 @@ func PostObject(c *gin.Context) {
236240

237241
// @Id deleteObject
238242
// @Router /storage/{bucket}/{objectID} [delete]
243+
// @Tags Internal
239244
// @Description "Delete an object from a bucket. This route is restricted to only Nebula Labs internal Projects."
240245
// @Param bucket path string true "Name of the bucket"
241246
// @Param objectID path string true "ID of the object"
@@ -270,6 +275,7 @@ func DeleteObject(c *gin.Context) {
270275

271276
// @Id objectUploadURL
272277
// @Router /storage/{bucket}/{objectID}/url [put]
278+
// @Tags Internal
273279
// @Accept json
274280
// @Description "Create's a new signed URL for target object"
275281
// @Param bucket path string true "Name of the bucket"

0 commit comments

Comments
 (0)