“mitao”
2026-03-27 cde5977f64ff1dfa928d1076c059e8865c02d70b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.tcm.training.admin.user.service.impl;
 
import com.tcm.training.admin.user.mapper.RbacQueryMapper;
import com.tcm.training.admin.user.service.RbacService;
import org.springframework.stereotype.Service;
 
import java.util.Collections;
import java.util.List;
 
@Service
public class RbacServiceImpl implements RbacService {
 
    private final RbacQueryMapper rbacQueryMapper;
 
    public RbacServiceImpl(RbacQueryMapper rbacQueryMapper) {
        this.rbacQueryMapper = rbacQueryMapper;
    }
 
    @Override
    public List<String> getRoleCodesByUserId(Long userId) {
        List<String> roleCodes = rbacQueryMapper.selectRoleCodesByUserId(userId);
        return roleCodes == null ? Collections.<String>emptyList() : roleCodes;
    }
 
    @Override
    public List<String> getPermissionKeysByUserId(Long userId) {
        List<String> permissionKeys = rbacQueryMapper.selectPermissionKeysByUserId(userId);
        return permissionKeys == null ? Collections.<String>emptyList() : permissionKeys;
    }
}