package com.mzl.flower.base.cache; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.HashOperations; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.ValueOperations; import org.springframework.stereotype.Component; @Component public class BaseCacheClient { @Autowired protected StringRedisTemplate stringRedisTemplate; @Autowired protected ValueOperations valueOperations; @Autowired protected HashOperations hashOperations; public String getKey(String... keys) { StringBuilder result = new StringBuilder(); for (String key : keys) { result.append(":" + key); } result.deleteCharAt(0); return result.toString(); } }