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 Details

  • Method Details

    • loadUserByUsername

      public org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException
      Specified by:
      loadUserByUsername in interface org.springframework.security.core.userdetails.UserDetailsService
      Throws:
      org.springframework.security.core.userdetails.UsernameNotFoundException
    • addUser

      public UserInfo addUser(UserInfo userInfo)
      Adds a new user to the system.
      Parameters:
      userInfo - the user information to add
      Returns:
      the added UserInfo
    • addVendorUser

      public Store addVendorUser(Store store)
      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

      public Store getVendorStoreByUserName(String user)
      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

      public UserInfo getUser(String userName)
      Retrieves user information by their username (email).
      Parameters:
      userName - the username (email) of the user
      Returns:
      the UserInfo associated with the given username