/**
 * Redis 服务代理
 * 从 Framework 获取 redisService
 */

const Framework = require("../framework/node-core-framework.js");

module.exports = new Proxy({}, {
  get(_, prop) {
    const services = Framework.getServices();
    const redisService = services?.redisService;
    
    if (!redisService) {
      throw new Error('Redis service not available. Framework may not be initialized.');
    }
    
    return typeof redisService[prop] === 'function' 
      ? redisService[prop].bind(redisService)
      : redisService[prop];
  }
});

