Package web.sportflow.user
Class UserService
java.lang.Object
web.sportflow.user.UserService
- All Implemented Interfaces:
org.springframework.security.core.userdetails.UserDetailsService
@Service
public class UserService
extends Object
implements org.springframework.security.core.userdetails.UserDetailsService
-
Constructor Summary
ConstructorsConstructorDescriptionUserService(UserRepository userRepository, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder) -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(String email, String rawPassword) doublecalculateBMI(User user) doublecalculateBMR(User user) createUser(User user, String rawPassword, String codeStatut, Collection<Long> organizedConferenceIds, Collection<Long> participatingConferenceIds) getAll()org.springframework.data.domain.Page<User> getAll(org.springframework.data.domain.Pageable pageable) getUserById(Long id) getWorkoutRecommendation(User user) org.springframework.security.core.userdetails.UserDetailsloadUserByUsername(String email) registerUser(RegistrationDTO registrationDTO) registerUser(RegistrationDTO registrationDTO, boolean isAdmin) Master registration method.voidorg.springframework.data.domain.Page<User> searchUsers(String searchString, org.springframework.data.domain.Pageable pageable) updateCurrentUserProfile(User currentUser, String firstname, String lastname, String email, Double weight, Double height, Sex sex, LocalDate birthDate, PracticeLevel level)
-
Constructor Details
-
UserService
public UserService(UserRepository userRepository, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)
-
-
Method Details
-
getAll
-
getAll
public org.springframework.data.domain.Page<User> getAll(org.springframework.data.domain.Pageable pageable) -
getUserById
-
createUser
@Transactional public User createUser(User user, String rawPassword, String codeStatut, Collection<Long> organizedConferenceIds, Collection<Long> participatingConferenceIds) -
authenticate
-
loadUserByUsername
public org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String email) throws org.springframework.security.core.userdetails.UsernameNotFoundException - Specified by:
loadUserByUsernamein interfaceorg.springframework.security.core.userdetails.UserDetailsService- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException
-
findAllUsers
-
findById
-
registerUser
-
registerUser
Master registration method. -
save
-
updateCurrentUserProfile
-
calculateBMI
-
calculateBMR
-
getWorkoutRecommendation
-
searchUsers
-