using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Shared { public interface IUserService { // Retrieves a user by their unique identifier (id). // 'id' is the unique identifier of the user. Task GetUserById(int id); // Retrieves a user by their username. // 'username' is the username of the user to be retrieved. Task GetUserByUsername(string username); // Retrieves a user by their email address. // 'email' is the email address of the user to be retrieved. Task GetUserByEmail(string email); // Retrieves all users. // This returns a list of users with pagination information (e.g., total count, page size). Task> GetAllUser(); // Retrieves a subset of users based on the provided index and page size. // 'index' is the starting point for pagination (page number). // 'pageSize' is the number of users per page. Task> GetSomeUser(int index, int pageSize); // Adds a new user to the system. // 'user' is the user object that will be added to the system. Task AddUser(TUser user); // Updates the details of an existing user identified by 'userId'. // 'userId' is the ID of the user to be updated, and 'user' contains the new user data. Task UpdateUser(int userId, TUser user); // Removes a user from the system based on their unique identifier ('userId'). // 'userId' is the unique identifier of the user to be removed. Task RemoveUser(int id); // Retrieves the hashed password for a given username. // 'username' is the username for which the password hash is to be retrieved. Task GetHashPassword(string username); // Checks if a username already exists. // 'username' is the username to check for existence. Task ExistUsername(string username); // Checks if an email address already exists. // 'email' is the email address to check for existence. Task ExistEmail(string email); // Sets the admin role for a user. // 'isAdmin' is a boolean indicating whether the user should have admin privileges. Task SetAdminRole(bool isAdmin); // Retrieves the total count of users. Task CountUser(); // Retrieves the last user ID. Task GetLastUserId(); } }