gongzuming
2024-09-02 c4017669a3fb411214e2716a5f11dc1a3c5e0a58
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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<String, String> valueOperations;
 
    @Autowired
    protected HashOperations<String, String, String> hashOperations;
 
    public String getKey(String... keys) {
        StringBuilder result = new StringBuilder();
        for (String key : keys) {
            result.append(":" + key);
        }
        result.deleteCharAt(0);
        return result.toString();
    }
 
 
}