-
Notifications
You must be signed in to change notification settings - Fork 0
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
10 changed files
with
200 additions
and
19 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
52 changes: 52 additions & 0 deletions
52
src/main/java/com/uh/rainbow/controller/SchedulerController.java
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,52 @@ | ||
package com.uh.rainbow.controller; | ||
|
||
import com.uh.rainbow.dto.request.ScheduleTemplate; | ||
import com.uh.rainbow.dto.response.ResponseDTO; | ||
import com.uh.rainbow.service.HTMLParserService; | ||
import com.uh.rainbow.service.SchedulerService; | ||
import com.uh.rainbow.util.filter.CourseFilter; | ||
import com.uh.rainbow.util.logging.Logger; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* <b>File:</b> SchedulerController | ||
* <p> | ||
* <b>Description:</b> | ||
* | ||
* @author Derek Garcia | ||
*/ | ||
@RequestMapping("/v1/scheduler") | ||
@RestController(value = "SchedulerController") | ||
public class SchedulerController { | ||
|
||
private final static Logger LOGGER = new Logger(SchedulerController.class); | ||
private final HTMLParserService htmlParserService = new HTMLParserService(); | ||
private final SchedulerService schedulerService = new SchedulerService(); | ||
|
||
/** | ||
* GET Endpoint: /scheduler | ||
* Get list of University of Hawaii Campuses | ||
* | ||
* @return List of University of Hawaii Campuses and their ID's | ||
*/ | ||
@GetMapping(value = "") | ||
public ResponseEntity<ResponseDTO> getSchedules( @PathVariable String instID, | ||
@PathVariable String termID, | ||
@PathVariable String subjectID, | ||
@RequestParam(required = false) List<String> crn, | ||
@RequestParam(required = false) List<String> code, | ||
@RequestParam(required = false) String start_after, | ||
@RequestParam(required = false) String end_before, | ||
@RequestParam(required = false) String online, | ||
@RequestParam(required = false) String sync, | ||
@RequestParam(required = false) List<String> day, | ||
@RequestParam(required = false) List<String> instructor, | ||
@RequestParam(required = false) List<String> keyword) { | ||
// var cf = new CourseFilter.Builder() | ||
// var foo = this.htmlParserService.parseCourses() | ||
return null; | ||
} | ||
} |
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,11 @@ | ||
package com.uh.rainbow.dto.request; | ||
|
||
/** | ||
* <b>File:</b> BufferDTO.java | ||
* <p> | ||
* <b>Description:</b> | ||
* | ||
* @author Derek Garcia | ||
*/ | ||
public record BufferDTO() { | ||
} |
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,11 @@ | ||
package com.uh.rainbow.dto.request; | ||
|
||
/** | ||
* <b>File:</b> RulesDTO.java | ||
* <p> | ||
* <b>Description:</b> | ||
* | ||
* @author Derek Garcia | ||
*/ | ||
public record RulesDTO() { | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/uh/rainbow/dto/request/ScheduleTemplate.java
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,13 @@ | ||
package com.uh.rainbow.dto.request; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* <b>File:</b> ScheduleTemplate.java | ||
* <p> | ||
* <b>Description:</b> | ||
* | ||
* @author Derek Garcia | ||
*/ | ||
public record ScheduleTemplate(String instID, String termID, List<String> courses) { | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/uh/rainbow/dto/response/ScheduleResponseDTO.java
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,24 @@ | ||
package com.uh.rainbow.dto.response; | ||
|
||
import com.uh.rainbow.dto.schedule.ScheduleDTO; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* <b>File:</b> ScheduleResponseDTO.java | ||
* <p> | ||
* <b>Description:</b> | ||
* | ||
* @author Derek Garcia | ||
*/ | ||
public class ScheduleResponseDTO extends ResponseDTO { | ||
public final List<ScheduleDTO> schedules; | ||
|
||
/** | ||
* Create new Schedule response with list of valid schedules | ||
* | ||
*/ | ||
public ScheduleResponseDTO(List<ScheduleDTO> schedules) { | ||
this.schedules = schedules; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/uh/rainbow/dto/schedule/ScheduleDTO.java
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,21 @@ | ||
package com.uh.rainbow.dto.schedule; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* <b>File:</b> ScheduleDTO.java | ||
* <p> | ||
* <b>Description:</b> | ||
* | ||
* @author Derek Garcia | ||
*/ | ||
public record ScheduleDTO( | ||
List<ScheduleMeetingDTO> tba, | ||
List<ScheduleMeetingDTO> sunday, | ||
List<ScheduleMeetingDTO> monday, | ||
List<ScheduleMeetingDTO> tuesday, | ||
List<ScheduleMeetingDTO> wednesday, | ||
List<ScheduleMeetingDTO> thursday, | ||
List<ScheduleMeetingDTO> friday, | ||
List<ScheduleMeetingDTO> saturday) { | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/uh/rainbow/dto/schedule/ScheduleMeetingDTO.java
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,11 @@ | ||
package com.uh.rainbow.dto.schedule; | ||
|
||
/** | ||
* <b>File:</b> ScheduleMeetingDTO.java | ||
* <p> | ||
* <b>Description:</b> | ||
* | ||
* @author Derek Garcia | ||
*/ | ||
public record ScheduleMeetingDTO() { | ||
} |
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