Class StatisticsController
java.lang.Object
edu.ucsb.cs156.dining.controllers.ApiController
edu.ucsb.cs156.dining.controllers.StatisticsController
@RequestMapping("/api/statistics")
@RestController
public class StatisticsController
extends ApiController
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbestRatedItems(StatsWindow window, int limit, long minReviews) worstRatedItems(StatsWindow window, int limit, long minReviews) Methods inherited from class edu.ucsb.cs156.dining.controllers.ApiController
genericMessage, getCurrentUser, handleGenericException, handleUnsupportedOperation
-
Constructor Details
-
StatisticsController
public StatisticsController()
-
-
Method Details
-
getSummary
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping(value="", produces="application/json") public StatisticsController.StatisticsSummary getSummary() -
bestRatedItems
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping(value="/items/best", produces="application/json") public List<StatisticsController.RatedItem> bestRatedItems(@RequestParam(defaultValue="ALL") StatsWindow window, @RequestParam(defaultValue="10") int limit, @RequestParam(name="minReviews",defaultValue="3") long minReviews) -
worstRatedItems
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping(value="/items/worst", produces="application/json") public List<StatisticsController.RatedItem> worstRatedItems(@RequestParam(defaultValue="ALL") StatsWindow window, @RequestParam(defaultValue="10") int limit, @RequestParam(name="minReviews",defaultValue="3") long minReviews)
-