|
|
@@ -4,9 +4,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
@Component
|
|
|
public class RedisUtils {
|
|
|
- @Autowired
|
|
|
+// @Autowired
|
|
|
+ @Resource
|
|
|
private RedisTemplate<String, Object> redisTemplate;
|
|
|
public void set(String key, Object value) {
|
|
|
redisTemplate.opsForValue().set(key, value);
|