1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| package com.moral.monitor.util;
|
| import org.springframework.data.redis.core.RedisTemplate;
|
| public class RedisUtil {
|
| public static boolean hasKey(RedisTemplate<String, String> redis, String key) {
|
| return redis.hasKey(key);
| }
|
| public static void set(RedisTemplate<String, String> redis, String key, String value) {
|
| redis.opsForValue().set(key, value);
| }
|
| public static String get(RedisTemplate<String, String> redis, String key) {
|
| return redis.opsForValue().get(key);
| }
| }
|
|