

package io.modules.security.service.impl;

import cn.hutool.core.util.StrUtil;
import io.modules.security.dao.SysUserTokenDao;
import io.modules.security.entity.SysUserTokenEntity;
import io.modules.security.service.ShiroService;
import io.modules.security.user.UserDetail;
import io.modules.sys.dao.SysUserDao;
import io.modules.sys.entity.SysUserEntity;
import io.modules.sys.enums.SuperAdminEnum;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

@Service
@AllArgsConstructor
public class ShiroServiceImpl implements ShiroService {
    private final SysUserDao sysUserDao;
    private final SysUserTokenDao sysUserTokenDao;

    @Override
    public Set<String> getUserPermissions(UserDetail user) {
        //用户权限列表
        Set<String> permsSet = new HashSet<>();

        return permsSet;
    }

    @Override
    public SysUserTokenEntity getByToken(String token) {
        return sysUserTokenDao.getByToken(token);
    }

    @Override
    public SysUserEntity getUser(Long userId) {
        return sysUserDao.selectById(userId);
    }

}
