Class UserManagementController
java.lang.Object
callofproject.dev.authentication.controller.UserManagementController
@RequestMapping("api/auth/users")
@RestController
public class UserManagementController
extends Object
Authentication Controller
Copyleft (C), 2023, Cal-of-Project-Teams Developers.
All Rights free.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for the UserManagementController class. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Object>
findUserByUsername
(String username) Find user with given usernameorg.springframework.http.ResponseEntity<Object>
findUserByWordContains
(String word, int page) Find user with given page and word parameters.org.springframework.http.ResponseEntity<Object>
findUserProfileByUserId
(UUID userId) Find user Profile with idorg.springframework.http.ResponseEntity<Object>
findUserProfileByUsername
(String username) Find user Profile with usernameorg.springframework.http.ResponseEntity<Object>
findUserWithProfileByUserId
(UUID userId) Find user with profile with given idorg.springframework.http.ResponseEntity<Object>
Save user and give USER_ROLE automaticallyorg.springframework.http.ResponseEntity<Object>
Find user with given id
-
Constructor Details
-
UserManagementController
Constructor for the UserManagementController class. It is used to inject dependencies into the controller.- Parameters:
service
- The UserManagementService object to be injected.
-
-
Method Details
-
saveUser
@PostMapping("save/user") public org.springframework.http.ResponseEntity<Object> saveUser(@RequestBody UserSignUpRequestDTO dto) Save user and give USER_ROLE automatically- Parameters:
dto
- is userSignUpDTO- Returns:
- if success UserDTO else return Error Message
-
findUserByUsername
@GetMapping("find/user/username") public org.springframework.http.ResponseEntity<Object> findUserByUsername(@RequestParam("n") String username) Find user with given username- Parameters:
username
- is username of user- Returns:
- UserDTO wrapped in MessageResponseDTO
-
findUserByWordContains
@GetMapping("find/user/contains") public org.springframework.http.ResponseEntity<Object> findUserByWordContains(@RequestParam(value="word",required=false) String word, @RequestParam("p") int page) Find user with given page and word parameters.- Parameters:
word
- represent the containing in the usernamepage
- is page- Returns:
- UsersDTO
-
updateUserProfile
@PutMapping("update/user/profile") public org.springframework.http.ResponseEntity<Object> updateUserProfile(@RequestBody UserProfileUpdateDTO dto) Find user with given id- Parameters:
dto
- is update user profile dto- Returns:
- UserDTO wrapped in MessageResponseDTO
-
findUserProfileByUsername
@GetMapping("find/user/profile/username") public org.springframework.http.ResponseEntity<Object> findUserProfileByUsername(@RequestParam("uname") String username) Find user Profile with username- Parameters:
username
- is username of user- Returns:
- ResponseMessage wrapped in UserProfileDTO
-
findUserProfileByUserId
@GetMapping("find/user/profile/id") public org.springframework.http.ResponseEntity<Object> findUserProfileByUserId(@RequestParam("uid") UUID userId) Find user Profile with id- Parameters:
userId
- is id of user- Returns:
- ResponseMessage wrapped in UserProfileDTO
-
findUserWithProfileByUserId
@GetMapping("find/user-with-profile/id") public org.springframework.http.ResponseEntity<Object> findUserWithProfileByUserId(@RequestParam("uid") UUID userId) Find user with profile with given id- Parameters:
userId
- is id of user- Returns:
- UserWithProfileDTO wrapped in MessageResponseDTO
-