package xyz.wbsite.frame.provider;

import org.springframework.stereotype.Component;
import xyz.wbsite.frame.base.LocalData;
import xyz.wbsite.frame.base.UserEntity;

@Component
public class SimpleUserProvider implements UserProvider {

    public UserEntity getUser(String username) {
        String admin = LocalData.getProperty("web.url.auth.admin", "");
        if (!username.equals(admin)) {
            return null;
        }
        UserEntity userEntity = new UserEntity();
        userEntity.setId(0L);
        userEntity.setUserName(username);
        userEntity.setUserAlias("超级管理员");
        userEntity.setPassword(LocalData.getProperty("web.url.auth.pwd", ""));
        userEntity.putRes(".*");
        return userEntity;
    }
}