mirror of https://github.com/elunez/eladmin
代码优化
parent
0f3578c9be
commit
c6f579b126
|
@ -127,6 +127,7 @@ public class RedisConfig extends CachingConfigurerSupport {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings({"all"})
|
||||||
public CacheErrorHandler errorHandler() {
|
public CacheErrorHandler errorHandler() {
|
||||||
// 异常处理,当Redis发生异常时,打印日志,但是程序正常走
|
// 异常处理,当Redis发生异常时,打印日志,但是程序正常走
|
||||||
log.info("初始化 -> [{}]", "Redis CacheErrorHandler");
|
log.info("初始化 -> [{}]", "Redis CacheErrorHandler");
|
||||||
|
@ -152,7 +153,6 @@ public class RedisConfig extends CachingConfigurerSupport {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -161,7 +161,7 @@ public class RedisConfig extends CachingConfigurerSupport {
|
||||||
* @author /
|
* @author /
|
||||||
* @param <T>
|
* @param <T>
|
||||||
*/
|
*/
|
||||||
class FastJsonRedisSerializer<T> implements RedisSerializer<T> {
|
class FastJsonRedisSerializer<T> implements RedisSerializer<T> {
|
||||||
|
|
||||||
private final Class<T> clazz;
|
private final Class<T> clazz;
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ public class RedisConfig extends CachingConfigurerSupport {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public T deserialize(byte[] bytes) {
|
public T deserialize(byte[] bytes) {
|
||||||
if (bytes == null || bytes.length <= 0) {
|
if (bytes == null || bytes.length == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String str = new String(bytes, StandardCharsets.UTF_8);
|
String str = new String(bytes, StandardCharsets.UTF_8);
|
||||||
|
|
Loading…
Reference in New Issue