package cn.superdesk.uniorder.dubbo.consumer.common;

import cn.superdesk.uniorder.common.mq.redis.constants.RedisKeyPrefix;
import cn.superdesk.uniorder.dubbo.facade._commom.DubboRedisService;
import com.alibaba.dubbo.config.annotation.Reference;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class RedisDubboConsumerService {


	@Reference(version = "1.0.0", timeout = 30000, retries = -1)
	private DubboRedisService dubboRedisService;

	public Object hgetKey(String redisKey, String hashKey) {
		return dubboRedisService.hgetKey(redisKey, hashKey);
	}


	/**
	 * 功能说明:通过key获取保存到redis里的值
	 *
	 * @param keyPrefix key前缀
	 * @param key       key后缀
	 * @return
	 */
	public Object getKey(RedisKeyPrefix keyPrefix, String key) {
		return dubboRedisService.getKey(keyPrefix, key);
	}

}
