提交 d4b26597 编写于 作者: ibizdev's avatar ibizdev

ibizdev提交

上级 24c142ab
package cn.ibizlab.util.service; 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.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.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service("AuthenticationUserService")
public class AuthenticationUserService implements UserDetailsService {
@Autowired public interface AuthenticationUserService extends UserDetailsService {
private SimpleUserService userService;
@Override @Override
public UserDetails loadUserByUsername(String username){ @Cacheable( value="ibzdict_users",key = "'getByUsername:'+#p0")
return userService.getByUsername(username); AuthenticationUser loadUserByUsername(String username);
}
@Cacheable( value="ibzdict_users",key = "'getByUsername:'+#p0")
AuthenticationUser loadUserByLogin(String username,String password) throws BadRequestAlertException;
@Cacheable( value="ibzdict_users",key = "'getByUsername:'+#p1")
AuthenticationUser loadUserByLogin(String domain,String username,String password);
@CacheEvict( value="ibzdict_users",key = "'getByUsername:'+#p0")
void resetByUsername(String username);
} }
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册