@Service public class RedisService extends Object
Constructor and Description |
---|
RedisService() |
Modifier and Type | Method and Description |
---|---|
void |
del(String key)
delete by key
|
void |
delObj(Object key)
delete by key
|
String |
get(String key)
获取缓存字符串 根据key
|
Object |
getObj(Object key)
get object value by key
|
void |
set(String key,
String value,
Long second)
set value and cache timeout by str key
|
void |
setObj(Object key,
Object value,
Long second)
set value by key
|
public void set(String key, String value, Long second)
key
- 字符串keyvalue
- 字符串valuesecond
- 过期时间 单位 秒public Object getObj(Object key)
key
- obj keypublic void setObj(Object key, Object value, Long second)
key
- obj keyvalue
- obj valuesecond
- 过期时间 单位户 秒public void del(String key)
key
- keypublic void delObj(Object key)
key
- obj keyCopyright © 2019. All rights reserved.