Skip to content

Commit

Permalink
Task 44 : Define UserService
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapter1990 committed Jul 2, 2024
1 parent 3faf039 commit 224ebc2
Showing 1 changed file with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.springboot.ratelimiter.user.service;

import com.springboot.ratelimiter.common.model.page.CustomPage;
import com.springboot.ratelimiter.user.User;
import com.springboot.ratelimiter.user.payload.request.CreateUserRequest;
import com.springboot.ratelimiter.user.payload.request.UpdateUserRequest;
import com.springboot.ratelimiter.user.payload.request.UserPagingRequest;

/**
* Service interface named {@link UserService} for managing user operations.
*/
public interface UserService {

/**
* Creates a new user based on the provided CreateUserRequest.
*
* @param createUserRequest the CreateUserRequest containing user details
* @return the created User object
*/
User createUser(CreateUserRequest createUserRequest);

/**
* Retrieves a user by their unique identifier.
*
* @param id the identifier of the user to retrieve
* @return the User object if found, otherwise null
*/
User getUserById(String id);

/**
* Updates an existing user identified by their unique identifier.
*
* @param id the identifier of the user to update
* @param updateUserRequest the UpdateUserRequest containing updated user details
* @return the updated User object
*/
User updateUser(String id, UpdateUserRequest updateUserRequest);

/**
* Deletes a user by their unique identifier.
*
* @param id the identifier of the user to delete
*/
void deleteUserById(String id);

/**
* Retrieves a paginated list of users based on the provided UserPagingRequest.
*
* @param userPagingRequest the UserPagingRequest containing pagination parameters
* @return a CustomPage containing the list of users
*/
CustomPage<User> getUsers(UserPagingRequest userPagingRequest);

}

0 comments on commit 224ebc2

Please sign in to comment.