Class AdminController

java.lang.Object
web.sportflow.admin.AdminController

@Controller @RequestMapping("/admin") public class AdminController extends Object
  • Constructor Details

  • Method Details

    • showPanel

      @GetMapping({"","/","/panel"}) public String showPanel(org.springframework.ui.Model model)
    • showUsersPage

      @GetMapping("/users") public String showUsersPage(org.springframework.ui.Model model)
    • showSportsPage

      @GetMapping("/sports") public String showSportsPage(org.springframework.ui.Model model)
    • showWorkoutsPage

      @GetMapping("/workouts") public String showWorkoutsPage(org.springframework.ui.Model model)
    • showBadgesPage

      @GetMapping("/badges") public String showBadgesPage(org.springframework.ui.Model model)
    • showGoalsPage

      @GetMapping("/goals") public String showGoalsPage(org.springframework.ui.Model model)
    • showChallengesPage

      @GetMapping("/challenges") public String showChallengesPage(org.springframework.ui.Model model)
    • showFriendshipsPage

      @GetMapping("/friendships") public String showFriendshipsPage(org.springframework.ui.Model model)
    • createUser

      @PostMapping("/users/create") @Transactional public String createUser(@RequestParam String firstname, @RequestParam String lastname, @RequestParam String email, @RequestParam String password, @RequestParam Role role, @RequestParam Double weight, @RequestParam Double height, @RequestParam Sex sex, @RequestParam PracticeLevel level, @RequestParam(required=false) @DateTimeFormat(iso=DATE) LocalDate birthDate, @RequestParam(required=false) String profileImagePath, @RequestParam(name="sportIds",required=false) List<Long> sportIds, @RequestParam(name="badgeIds",required=false) List<Long> badgeIds, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • updateUser

      @PostMapping("/users/{userId}/update") @Transactional public String updateUser(@PathVariable Long userId, @RequestParam String firstname, @RequestParam String lastname, @RequestParam String email, @RequestParam(required=false) String password, @RequestParam Role role, @RequestParam Double weight, @RequestParam Double height, @RequestParam Sex sex, @RequestParam PracticeLevel level, @RequestParam(required=false) @DateTimeFormat(iso=DATE) LocalDate birthDate, @RequestParam(required=false) String profileImagePath, @RequestParam(name="sportIds",required=false) List<Long> sportIds, @RequestParam(name="badgeIds",required=false) List<Long> badgeIds, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • deleteUser

      @PostMapping("/users/{userId}/delete") @Transactional public String deleteUser(@PathVariable Long userId, @AuthenticationPrincipal User currentUser, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • createSport

      @PostMapping("/sports/create") @Transactional public String createSport(@RequestParam String name, @RequestParam(name="caloriesPerMinute") Double caloriesPerMinute, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • updateSport

      @PostMapping("/sports/{sportId}/update") @Transactional public String updateSport(@PathVariable Long sportId, @RequestParam String name, @RequestParam(name="caloriesPerMinute") Double caloriesPerMinute, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • deleteSport

      @PostMapping("/sports/{sportId}/delete") @Transactional public String deleteSport(@PathVariable Long sportId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • createBadge

      @PostMapping("/badges/create") @Transactional public String createBadge(@RequestParam String name, @RequestParam(required=false) String description, @RequestParam(required=false) String iconPath, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • updateBadge

      @PostMapping("/badges/{badgeId}/update") @Transactional public String updateBadge(@PathVariable Long badgeId, @RequestParam String name, @RequestParam(required=false) String description, @RequestParam(required=false) String iconPath, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • deleteBadge

      @PostMapping("/badges/{badgeId}/delete") @Transactional public String deleteBadge(@PathVariable Long badgeId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • createGoal

      @PostMapping("/goals/create") @Transactional public String createGoal(@RequestParam String label, @RequestParam GoalType type, @RequestParam Double targetValue, @RequestParam Double currentValue, @RequestParam String unit, @RequestParam Long userId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • updateGoal

      @PostMapping("/goals/{goalId}/update") @Transactional public String updateGoal(@PathVariable Long goalId, @RequestParam String label, @RequestParam GoalType type, @RequestParam Double targetValue, @RequestParam Double currentValue, @RequestParam String unit, @RequestParam Long userId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • deleteGoal

      @PostMapping("/goals/{goalId}/delete") @Transactional public String deleteGoal(@PathVariable Long goalId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • createWorkout

      @PostMapping("/workouts/create") @Transactional public String createWorkout(@RequestParam String name, @RequestParam(required=false) String description, @RequestParam @DateTimeFormat(iso=DATE_TIME) LocalDateTime date, @RequestParam(required=false) String address, @RequestParam(required=false) String rating, @RequestParam List<WorkoutExercise> workoutExercises, @RequestParam Long sportId, @RequestParam Long userId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • updateWorkout

      @PostMapping("/workouts/{workoutId}/update") @Transactional public String updateWorkout(@PathVariable Long workoutId, @RequestParam String name, @RequestParam(required=false) String description, @RequestParam @DateTimeFormat(iso=DATE_TIME) LocalDateTime date, @RequestParam(required=false) String address, @RequestParam(required=false) String rating, @RequestParam List<WorkoutExercise> workoutExercises, @RequestParam Long sportId, @RequestParam Long userId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • deleteWorkout

      @PostMapping("/workouts/{workoutId}/delete") @Transactional public String deleteWorkout(@PathVariable Long workoutId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • createChallenge

      @PostMapping("/challenges/create") @Transactional public String createChallenge(@RequestParam String title, @RequestParam(required=false) String description, @RequestParam ChallengeType type, @RequestParam Double targetValue, @RequestParam @DateTimeFormat(iso=DATE) LocalDate startDate, @RequestParam @DateTimeFormat(iso=DATE) LocalDate endDate, @RequestParam Long creatorId, @RequestParam(defaultValue="false") boolean official, @RequestParam(name="sportIds",required=false) List<Long> sportIds, @RequestParam(name="participantIds",required=false) List<Long> participantIds, @RequestParam(name="badgeIds",required=false) List<Long> badgeIds, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • updateChallenge

      @PostMapping("/challenges/{challengeId}/update") @Transactional public String updateChallenge(@PathVariable Long challengeId, @RequestParam String title, @RequestParam(required=false) String description, @RequestParam ChallengeType type, @RequestParam Double targetValue, @RequestParam @DateTimeFormat(iso=DATE) LocalDate startDate, @RequestParam @DateTimeFormat(iso=DATE) LocalDate endDate, @RequestParam Long creatorId, @RequestParam(defaultValue="false") boolean official, @RequestParam(name="sportIds",required=false) List<Long> sportIds, @RequestParam(name="participantIds",required=false) List<Long> participantIds, @RequestParam(name="badgeIds",required=false) List<Long> badgeIds, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • deleteChallenge

      @PostMapping("/challenges/{challengeId}/delete") @Transactional public String deleteChallenge(@PathVariable Long challengeId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • createFriendship

      @PostMapping("/friendships/create") @Transactional public String createFriendship(@RequestParam Long requesterId, @RequestParam Long addresseeId, @RequestParam FriendshipStatus status, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • updateFriendship

      @PostMapping("/friendships/{friendshipId}/update") @Transactional public String updateFriendship(@PathVariable Long friendshipId, @RequestParam Long requesterId, @RequestParam Long addresseeId, @RequestParam FriendshipStatus status, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • deleteFriendship

      @PostMapping("/friendships/{friendshipId}/delete") @Transactional public String deleteFriendship(@PathVariable Long friendshipId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)