Package web.sportflow.admin
Class AdminController
java.lang.Object
web.sportflow.admin.AdminController
-
Constructor Summary
ConstructorsConstructorDescriptionAdminController(UserRepository userRepository, SportRepository sportRepository, WorkoutRepository workoutRepository, WorkoutExerciseRepository workoutExerciseRepository, ExerciseRepository exerciseRepository, SportService sportService, BadgeRepository badgeRepository, GoalRepository goalRepository, ChallengeRepository challengeRepository, FriendshipRepository friendshipRepository, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder) -
Method Summary
Modifier and TypeMethodDescriptioncreateBadge(String name, String description, String iconPath, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) createChallenge(String title, String description, ChallengeType type, Double targetValue, LocalDate startDate, LocalDate endDate, Long creatorId, boolean official, List<Long> sportIds, List<Long> participantIds, List<Long> badgeIds, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) createFriendship(Long requesterId, Long addresseeId, FriendshipStatus status, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) createGoal(String label, GoalType type, Double targetValue, Double currentValue, String unit, Long userId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) createSport(String name, Double caloriesPerMinute, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) createUser(String firstname, String lastname, String email, String password, Role role, Double weight, Double height, Sex sex, PracticeLevel level, LocalDate birthDate, String profileImagePath, List<Long> sportIds, List<Long> badgeIds, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) createWorkout(String name, String description, LocalDateTime date, String address, String rating, List<WorkoutExercise> workoutExercises, Long sportId, Long userId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) deleteBadge(Long badgeId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) deleteChallenge(Long challengeId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) deleteFriendship(Long friendshipId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) deleteGoal(Long goalId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) deleteSport(Long sportId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) deleteUser(Long userId, User currentUser, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) deleteWorkout(Long workoutId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) showBadgesPage(org.springframework.ui.Model model) showChallengesPage(org.springframework.ui.Model model) showFriendshipsPage(org.springframework.ui.Model model) showGoalsPage(org.springframework.ui.Model model) showPanel(org.springframework.ui.Model model) showSportsPage(org.springframework.ui.Model model) showUsersPage(org.springframework.ui.Model model) showWorkoutsPage(org.springframework.ui.Model model) updateBadge(Long badgeId, String name, String description, String iconPath, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) updateChallenge(Long challengeId, String title, String description, ChallengeType type, Double targetValue, LocalDate startDate, LocalDate endDate, Long creatorId, boolean official, List<Long> sportIds, List<Long> participantIds, List<Long> badgeIds, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) updateFriendship(Long friendshipId, Long requesterId, Long addresseeId, FriendshipStatus status, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) updateGoal(Long goalId, String label, GoalType type, Double targetValue, Double currentValue, String unit, Long userId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) updateSport(Long sportId, String name, Double caloriesPerMinute, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) updateUser(Long userId, String firstname, String lastname, String email, String password, Role role, Double weight, Double height, Sex sex, PracticeLevel level, LocalDate birthDate, String profileImagePath, List<Long> sportIds, List<Long> badgeIds, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) updateWorkout(Long workoutId, String name, String description, LocalDateTime date, String address, String rating, List<WorkoutExercise> workoutExercises, Long sportId, Long userId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
-
Constructor Details
-
AdminController
public AdminController(UserRepository userRepository, SportRepository sportRepository, WorkoutRepository workoutRepository, WorkoutExerciseRepository workoutExerciseRepository, ExerciseRepository exerciseRepository, SportService sportService, BadgeRepository badgeRepository, GoalRepository goalRepository, ChallengeRepository challengeRepository, FriendshipRepository friendshipRepository, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)
-
-
Method Details
-
showPanel
-
showUsersPage
-
showSportsPage
-
showWorkoutsPage
-
showBadgesPage
-
showGoalsPage
-
showChallengesPage
-
showFriendshipsPage
-
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
-
createSport
-
updateSport
-
deleteSport
-
createBadge
-
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
-
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
-
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
-
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
-
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
-