Class AthleteController
java.lang.Object
fr.utc.miage.sporttrack.controller.AthleteController
Spring MVC controller for athlete-related pages.
Provides the athlete list view with optional search and badge display.
- Author:
- SportTrack Team
-
Constructor Summary
ConstructorsConstructorDescriptionAthleteController(AthleteService athleteService, BadgeService badgeService) Constructs anAthleteControllerwith the required services. -
Method Summary
Modifier and TypeMethodDescriptionlistAthletes(String query, org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) Displays the list of all athletes, optionally filtered by a search query.
-
Constructor Details
-
AthleteController
Constructs anAthleteControllerwith the required services.- Parameters:
athleteService- the athlete servicebadgeService- the badge service
-
-
Method Details
-
listAthletes
@GetMapping("/list") public String listAthletes(@RequestParam(name="q",required=false) String query, org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) Displays the list of all athletes, optionally filtered by a search query. Also includes the three most recent badges per athlete for display.- Parameters:
query- the optional search keyword for filtering by usernamemodel- the Spring MVC modelauthentication- the current security authentication- Returns:
- the view name "athlete/list"
-