AuthenticationUserService.java 1.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
package cn.ibizlab.util.service;


import cn.ibizlab.util.errors.BadRequestAlertException;
import cn.ibizlab.util.security.AuthenticationUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.stereotype.Service;


public interface AuthenticationUserService extends UserDetailsService {


    @Override
18
    @Cacheable( value="ibzuaa_users", key = "'getByUsername:'+#p0")
19 20 21 22
    default AuthenticationUser loadUserByUsername(String username){
        return null ;
    }

23

24
    @Cacheable( value="ibzuaa_users", key = "'getByUsername:'+#p0")
25 26
    AuthenticationUser loadUserByLogin(String username,String password);

27
    @CacheEvict( value="ibzuaa_users", key = "'glob:*getByUsername:'+#p0")
28 29 30
    default void resetByUsername(String username){}


31
}