Package com.mt.ecommerce.product.service
Class UserInfoService
java.lang.Object
com.mt.ecommerce.product.service.UserInfoService
- All Implemented Interfaces:
org.springframework.security.core.userdetails.UserDetailsService
@Service
public class UserInfoService
extends Object
implements org.springframework.security.core.userdetails.UserDetailsService
Service class for managing user information and authentication.
Implements UserDetailsService for Spring Security integration.
-
Constructor Summary
ConstructorsConstructorDescriptionUserInfoService
(UserInfoRepository repository, org.springframework.security.crypto.password.PasswordEncoder encoder, VendorRepository vendorRepository, UserVendorRepository userVendorRepository) -
Method Summary
Modifier and TypeMethodDescriptionAdds a new user to the system.addVendorUser
(Store store) Adds a vendor user to the system.Retrieves user information by their username (email).Retrieves the store information associated with a vendor user by their username.org.springframework.security.core.userdetails.UserDetails
loadUserByUsername
(String username)
-
Constructor Details
-
UserInfoService
public UserInfoService(UserInfoRepository repository, org.springframework.security.crypto.password.PasswordEncoder encoder, VendorRepository vendorRepository, UserVendorRepository userVendorRepository)
-
-
Method Details
-
loadUserByUsername
public org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException - Specified by:
loadUserByUsername
in interfaceorg.springframework.security.core.userdetails.UserDetailsService
- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException
-
addUser
Adds a new user to the system.- Parameters:
userInfo
- the user information to add- Returns:
- the added UserInfo
-
addVendorUser
Adds a vendor user to the system.- Parameters:
store
- the store information containing user and vendor details- Returns:
- the added Store with user and vendor information
-
getVendorStoreByUserName
Retrieves the store information associated with a vendor user by their username.- Parameters:
user
- the username of the vendor user- Returns:
- the Store information containing user and vendor details
-
getUser
Retrieves user information by their username (email).- Parameters:
userName
- the username (email) of the user- Returns:
- the UserInfo associated with the given username
-