|
@@ -116,7 +116,7 @@ public class RedisService<T> {
|
|
*/
|
|
*/
|
|
public Boolean set(String key, T value) {
|
|
public Boolean set(String key, T value) {
|
|
try {
|
|
try {
|
|
- redisTemplate.opsForValue().set(key, value, null);
|
|
|
|
|
|
+ redisTemplate.opsForValue().set(key, value);
|
|
return true;
|
|
return true;
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error(e.getMessage(), e);
|
|
log.error(e.getMessage(), e);
|
|
@@ -186,7 +186,7 @@ public class RedisService<T> {
|
|
return redisTemplate.opsForHash().get(key, item);
|
|
return redisTemplate.opsForHash().get(key, item);
|
|
}
|
|
}
|
|
|
|
|
|
- public <T> T hget(String key, String item, Class<T> clazz) {
|
|
|
|
|
|
+ public <t> t hget(String key, String item, Class<t> clazz) {
|
|
Object val = this.hget(key, item);
|
|
Object val = this.hget(key, item);
|
|
if (clazz.isInstance(val)) {
|
|
if (clazz.isInstance(val)) {
|
|
return clazz.cast(val);
|
|
return clazz.cast(val);
|
|
@@ -289,7 +289,7 @@ public class RedisService<T> {
|
|
* @param key 键 不能为 null
|
|
* @param key 键 不能为 null
|
|
* @param item 项 可以使多个不能为 null
|
|
* @param item 项 可以使多个不能为 null
|
|
*/
|
|
*/
|
|
- public void hdel(String key, T... item) {
|
|
|
|
|
|
+ public void hdel(String key, Object... item) {
|
|
redisTemplate.opsForHash().delete(key, item);
|
|
redisTemplate.opsForHash().delete(key, item);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -420,7 +420,7 @@ public class RedisService<T> {
|
|
* @param values 值 可以是多个
|
|
* @param values 值 可以是多个
|
|
* @return 移除的个数
|
|
* @return 移除的个数
|
|
*/
|
|
*/
|
|
- public Long setRemove(String key, T... values) {
|
|
|
|
|
|
+ public Long setRemove(String key, Object... values) {
|
|
try {
|
|
try {
|
|
return redisTemplate.opsForSet().remove(key, values);
|
|
return redisTemplate.opsForSet().remove(key, values);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|