cloudroam
2024-09-10 33a30da7b2795fc60ebab8e89760087f5dfdd3a0
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
package com.mzl.flower.base.cache;
 
import org.springframework.stereotype.Component;
 
import java.util.concurrent.TimeUnit;
 
@Component
public class StringCacheClient extends BaseCacheClient {
 
    public void set(String key, String value) {
        this.valueOperations.set(this.getKey(new String[]{key}), value);
    }
 
    public void set(String key, String value, long timeout) {
        this.valueOperations.set(this.getKey(new String[]{key}), value, timeout, TimeUnit.SECONDS);
    }
 
    public String get(String key) {
        return (String)this.valueOperations.get(this.getKey(new String[]{key}));
    }
 
    public void delete(String key) {
        this.stringRedisTemplate.delete(this.getKey(new String[]{key}));
    }
 
}