Class MealController

java.lang.Object
edu.ucsb.cs156.dining.controllers.MealController

@RestController @RequestMapping("/api/diningcommons") public class MealController extends Object
Controller for Meal
  • 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 LocalDateTime
      diningCommonsCode - the dining commons code
      Returns:
      a list of meals
      Throws:
      Exception - if the API request fails