Class UserController

java.lang.Object
web.sportflow.user.UserController

@Controller @RequestMapping({"/users","/user"}) public class UserController extends Object
  • Constructor Details

  • Method Details

    • showMenu

      @GetMapping({"","/"}) public String showMenu()
    • showCreateForm

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

      @PostMapping("/create") public String createUser(@ModelAttribute User user, @RequestParam String password, @RequestParam String codeStatut, @RequestParam(name="organizedConferenceIds",required=false) List<Long> organizedConferenceIds, @RequestParam(name="participatingConferenceIds",required=false) List<Long> participatingConferenceIds, org.springframework.ui.Model model)
    • showProfile

      @GetMapping("/profile") public String showProfile(@AuthenticationPrincipal User currentUser, org.springframework.ui.Model model)
    • showUserProfile

      @GetMapping({"/profile/{userId:[0-9]+}","/{userId:[0-9]+}/profile"}) public String showUserProfile(@AuthenticationPrincipal User currentUser, @PathVariable Long userId, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • showEditProfile

      @GetMapping("/profile/edit") public String showEditProfile(@AuthenticationPrincipal User currentUser, org.springframework.ui.Model model)
    • updateProfile

      @PostMapping("/profile/edit") public String updateProfile(@AuthenticationPrincipal User currentUser, @RequestParam String firstname, @RequestParam String lastname, @RequestParam String email, @RequestParam Double weight, @RequestParam Double height, @RequestParam Sex sex, @RequestParam PracticeLevel level, @RequestParam(required=false) @DateTimeFormat(iso=DATE) LocalDate birthDate, @RequestParam(name="avatarFile",required=false) org.springframework.web.multipart.MultipartFile avatarFile, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • redirectUsersPage

      @GetMapping("/users") public String redirectUsersPage()
    • registerUser

      @PostMapping("/register") public String registerUser(@ModelAttribute RegistrationDTO registrationDTO, org.springframework.ui.Model model)
    • manageFriends

      @GetMapping("/friends") public String manageFriends(@AuthenticationPrincipal User currentUser, @RequestParam(value="q",required=false) String query, @PageableDefault(size=10,sort="lastname") org.springframework.data.domain.Pageable pageable, org.springframework.ui.Model model)
    • showChallenges

      @GetMapping("/challenges") public String showChallenges(@AuthenticationPrincipal User currentUser, @RequestParam(value="q",required=false) String query, org.springframework.ui.Model model)
    • joinChallenge

      @PostMapping("/challenges/{challengeId}/join") public String joinChallenge(@AuthenticationPrincipal User currentUser, @PathVariable Long challengeId, @RequestParam(defaultValue="/users/challenges") String returnTo, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • leaveChallenge

      @PostMapping("/challenges/{challengeId}/leave") public String leaveChallenge(@AuthenticationPrincipal User currentUser, @PathVariable Long challengeId, @RequestParam(defaultValue="/users/challenges") String returnTo, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • sendFriendRequest

      @PostMapping("/friends/request") public String sendFriendRequest(@AuthenticationPrincipal User currentUser, @RequestParam Long targetUserId, @RequestParam(defaultValue="/users/friends") String returnTo, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • acceptFriendRequest

      @PostMapping("/friends/accept") public String acceptFriendRequest(@AuthenticationPrincipal User currentUser, @RequestParam Long friendshipId, @RequestParam(defaultValue="/users/friends") String returnTo, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • refuseFriendRequest

      @PostMapping("/friends/refuse") public String refuseFriendRequest(@AuthenticationPrincipal User currentUser, @RequestParam Long friendshipId, @RequestParam(defaultValue="/users/friends") String returnTo, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • unfriend

      @PostMapping("/friends/unfriend") public String unfriend(@AuthenticationPrincipal User currentUser, @RequestParam Long friendId, @RequestParam(defaultValue="/users/friends") String returnTo, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • showWorkout

      @GetMapping("/workout") public String showWorkout(org.springframework.ui.Model model)
    • redirectGoalsPage

      @GetMapping({"/goal","/goals"}) public String redirectGoalsPage()
    • showDashboard

      @GetMapping("/dashboard") public String showDashboard(@AuthenticationPrincipal User currentUser, org.springframework.ui.Model model)
    • showStatistiquePage

      @GetMapping("/statistique") public String showStatistiquePage(@AuthenticationPrincipal User currentUser, org.springframework.ui.Model model)