class RedisTokensServiceImpl implements ITokensService {
    private final static SerializationCodec AUTH_CODEC = new SerializationCodec();
    private static final String AUTHORIZATION = "token";
    private final RedissonClient redisson;

    @Override
    public PageResult<TokenVo> listTokens(Map<String, Object> params, String clientId) {<FILL_FUNCTION_BODY>}

    /**
     * 根据请求参数生成redis的key
     */
    private String getRedisKey(Map<String, Object> params, String clientId) {
        String result;
        String username = MapUtils.getString(params, "username");
        if (StrUtil.isNotEmpty(username)) {
            result = this.buildKey(SecurityConstants.REDIS_UNAME_TO_ACCESS, clientId + "::" + username);
        } else {
            result = this.buildKey(SecurityConstants.REDIS_CLIENT_ID_TO_ACCESS, clientId);
        }
        return result;
    }

    private String buildKey(String type, String id) {
        return String.format("%s::%s::%s", AUTHORIZATION, type, id);
    }
}

        Integer page = MapUtils.getInteger(params, "page");
        Integer limit = MapUtils.getInteger(params, "limit");
        int[] startEnds = PageUtil.transToStartEnd(page-1, limit);
        //根据请求参数生成redis的key
        String redisKey = getRedisKey(params, clientId);
        RList<String> tokenList = redisson.getList(redisKey);
        long size = tokenList.size();
        List<TokenVo> result = new ArrayList<>(limit);
        //查询token集合
        List<String> tokens = tokenList.range(startEnds[0], startEnds[1]-1);
        if (tokens != null) {
            for (String token : tokens) {
                //构造token对象
                TokenVo tokenVo = new TokenVo();
                tokenVo.setTokenValue(token);
                //获取用户信息
                RBucket<OAuth2Authorization> rBucket = redisson.getBucket(buildKey(OAuth2ParameterNames.ACCESS_TOKEN, token), AUTH_CODEC);
                OAuth2Authorization authorization = rBucket.get();
                if (authorization != null) {
                    OAuth2AccessToken accessToken = authorization.getAccessToken().getToken();
                    if (accessToken != null && accessToken.getExpiresAt() != null) {
                        tokenVo.setExpiration(Date.from(accessToken.getExpiresAt()));
                    }
                    tokenVo.setUsername(authorization.getPrincipalName());
                    tokenVo.setClientId(authorization.getRegisteredClientId());
                    tokenVo.setGrantType(authorization.getAuthorizationGrantType().getValue());

                    String accountType = (String)authorization.getAttributes().get(SecurityConstants.ACCOUNT_TYPE_PARAM_NAME);
                    tokenVo.setAccountType(accountType);
                }
                result.add(tokenVo);
            }
        }
        return PageResult.<TokenVo>builder().data(result).code(0).count(size).build();
    
<no_super_class>