Class MealController
java.lang.Object
edu.ucsb.cs156.dining.controllers.MealController
Controller for Meal
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetMeals
(LocalDateTime dateTime, String diningCommonsCode) Endpoint to fetch all meals served in a particular dining commons on a specific date.
-
Constructor Details
-
MealController
public MealController()
-
-
Method Details
-
getMeals
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/{dateTime}/{diningCommonsCode}") public List<Meal> getMeals(@PathVariable LocalDateTime dateTime, @PathVariable String diningCommonsCode) throws Exception Endpoint to fetch all meals served in a particular dining commons on a specific date.- Parameters:
dateTime
- the date and time as a LocalDateTimediningCommonsCode
- the dining commons code- Returns:
- a list of meals
- Throws:
Exception
- if the API request fails
-