Package ru.kpekepsalt.ruvik.service.Impl
Class UserServiceImpl
- java.lang.Object
-
- ru.kpekepsalt.ruvik.service.Impl.UserServiceImpl
-
- All Implemented Interfaces:
UserService
@Service public class UserServiceImpl extends Object implements UserService
Service for user profile operations
-
-
Constructor Summary
Constructors Constructor Description UserServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description User
createUser(UserDto userDto)
Creates user profileUser
findById(Long id)
Search User by idUser
findByLogin(String login)
Searches for user with given loginUser
findByToken(String token)
Searches for user with given tokenUser
getCurrentUser()
Get current user profile databoolean
isAuth()
Checks if user is authorizedvoid
save(User user)
Saves user dataUser
updateUser(User user)
Updates user profile
-
-
-
Method Detail
-
findById
public User findById(Long id)
Description copied from interface:UserService
Search User by id- Specified by:
findById
in interfaceUserService
- Parameters:
id
- User id- Returns:
- User data or null if not exists
-
save
public void save(User user) throws DataValidityException
Description copied from interface:UserService
Saves user data- Specified by:
save
in interfaceUserService
- Parameters:
user
- User data to save- Throws:
DataValidityException
-
createUser
public User createUser(UserDto userDto) throws DataValidityException
Description copied from interface:UserService
Creates user profile- Specified by:
createUser
in interfaceUserService
- Parameters:
userDto
- User information- Returns:
- Saved user profile data
- Throws:
DataValidityException
-
updateUser
public User updateUser(User user) throws DataValidityException
Description copied from interface:UserService
Updates user profile- Specified by:
updateUser
in interfaceUserService
- Parameters:
user
- User profile data- Returns:
- Updated user profile data
- Throws:
DataValidityException
-
findByToken
public User findByToken(String token)
Description copied from interface:UserService
Searches for user with given token- Specified by:
findByToken
in interfaceUserService
- Parameters:
token
- User token- Returns:
- User or null if not exists
-
getCurrentUser
public User getCurrentUser()
Description copied from interface:UserService
Get current user profile data- Specified by:
getCurrentUser
in interfaceUserService
- Returns:
- Current user's data
-
isAuth
public boolean isAuth()
Description copied from interface:UserService
Checks if user is authorized- Specified by:
isAuth
in interfaceUserService
- Returns:
- User authorization status
-
findByLogin
public User findByLogin(String login)
Description copied from interface:UserService
Searches for user with given login- Specified by:
findByLogin
in interfaceUserService
- Parameters:
login
- User login- Returns:
- User data or null if not exists
-
-