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 Details

    • UserManagementController

      public UserManagementController(UserManagementService service)
      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 username
      page - 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