Skip to content

Commit fa6b717

Browse files
Add missing javadocs
1 parent d89ff23 commit fa6b717

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

IndividualProject/src/main/java/dev/coms4156/project/individualproject/Course.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
import java.io.*;
44

5+
/**
6+
* Represents a course within a department.
7+
* This class stores information about the course, including its location, time slot,
8+
* the instructor name, enrollment count and capacity.
9+
*/
510
public class Course implements Serializable {
611

712
/**

IndividualProject/src/main/java/dev/coms4156/project/individualproject/RouteController.java

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,19 @@ public ResponseEntity<?> dropStudent(@RequestParam(value = "deptCode") String de
368368
}
369369
}
370370

371-
371+
/**
372+
* Endpoint for setting the enrollment count for a specified course.
373+
* This method handles PATCH requests to change the enrollment count of a course identified by
374+
* department code and course code. If the course exists, its enrollment count is updated to the
375+
* provided enrollment count (if valid).
376+
*
377+
* @param deptCode A {@code String} representing the department.
378+
* @param courseCode A {@code int} representing the course within the department.
379+
* @param count A {@code int} representing the enrollment count to be set for this course.
380+
* @return A {@code ResponseEntity} object containing an HTTP 200
381+
* response with an appropriate message or the proper status
382+
* code in tune with what has happened.
383+
*/
372384
@PatchMapping(value = "/setEnrollmentCount", produces = MediaType.APPLICATION_JSON_VALUE)
373385
public ResponseEntity<?> setEnrollmentCount(@RequestParam(value = "deptCode") String deptCode,
374386
@RequestParam(value = "courseCode") int courseCode,
@@ -467,7 +479,18 @@ public ResponseEntity<?> changeCourseTeacher(@RequestParam(value = "deptCode") S
467479
}
468480
}
469481

470-
482+
/**
483+
* Endpoint for changing the location of a course.
484+
* This method handles PATCH requests to change the location of a course identified by
485+
* department code and course code. If the course exists, its location is updated to the
486+
* provided location.
487+
*
488+
* @param deptCode the code of the department containing the course
489+
* @param courseCode the code of the course to change the instructor for
490+
* @param location the new location for the course
491+
* @return a ResponseEntity with a success message if the operation is
492+
* successful, or an error message if the course is not found
493+
*/
471494
@PatchMapping(value = "/changeCourseLocation", produces = MediaType.APPLICATION_JSON_VALUE)
472495
public ResponseEntity<?> changeCourseLocation(@RequestParam(value = "deptCode") String deptCode,
473496
@RequestParam(value = "courseCode") int courseCode,

IndividualProject/src/test/java/dev/coms4156/project/individualproject/CourseUnitTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
import org.springframework.boot.test.context.SpringBootTest;
77
import org.springframework.test.context.ContextConfiguration;
88

9+
/**
10+
* This class contains unit tests for the course class.
11+
*/
912
@SpringBootTest
1013
@ContextConfiguration
1114
public class CourseUnitTests {

0 commit comments

Comments
 (0)