Klasse UserController
java.lang.Object
com.spaghetticodegang.trylater.user.UserController
REST controller providing endpoints for user management.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungorg.springframework.http.ResponseEntity
<Void> deleteUser
(User me, @Valid UserMeDeleteDto userMeDeleteDto) org.springframework.http.ResponseEntity
<UserMeResponseDto> Returns the public profile information of the currently authenticated user.org.springframework.http.ResponseEntity
<UserMeResponseDto> registerUser
(@Valid UserMeRegistrationDto userMeRegistrationDto) Handles the user registration request by delegating to the service layer.org.springframework.http.ResponseEntity
<UserResponseDto> searchUser
(String user) Searches for a user by userName or email.org.springframework.http.ResponseEntity
<UserMeResponseDto> updateUserProfile
(User me, @Valid UserMeUpdateDto userMeUpdateDto) Handles the user profile update request by delegating to the service layer.
-
Konstruktordetails
-
UserController
public UserController()
-
-
Methodendetails
-
getUserMe
@GetMapping("/me") public org.springframework.http.ResponseEntity<UserMeResponseDto> getUserMe(@AuthenticationPrincipal User me) Returns the public profile information of the currently authenticated user.- Parameter:
me
- the currently authenticated user (injected by Spring Security)- Gibt zurück:
- the authenticated user's public information
-
registerUser
@PostMapping public org.springframework.http.ResponseEntity<UserMeResponseDto> registerUser(@RequestBody @Valid @Valid UserMeRegistrationDto userMeRegistrationDto) Handles the user registration request by delegating to the service layer.- Parameter:
userMeRegistrationDto
- the registration data provided by the user- Gibt zurück:
- the created user's public information
-
searchUser
@GetMapping("/search") public org.springframework.http.ResponseEntity<UserResponseDto> searchUser(@RequestParam String user) Searches for a user by userName or email.- Parameter:
user
- for search criteria- Gibt zurück:
- the matching user`s public information
-
updateUserProfile
@PatchMapping("/me") public org.springframework.http.ResponseEntity<UserMeResponseDto> updateUserProfile(@AuthenticationPrincipal User me, @RequestBody @Valid @Valid UserMeUpdateDto userMeUpdateDto) Handles the user profile update request by delegating to the service layer.- Parameter:
me
- the currently authenticated user (injected by Spring Security)userMeUpdateDto
- the updated data provided by the user- Gibt zurück:
- the updated user's public information
-
deleteUser
@DeleteMapping("/me") public org.springframework.http.ResponseEntity<Void> deleteUser(@AuthenticationPrincipal User me, @RequestBody @Valid @Valid UserMeDeleteDto userMeDeleteDto)
-