commit
fdd732250a
|
@ -36,7 +36,7 @@ public class ZLMRESTfulUtils {
|
|||
// 设置连接超时时间
|
||||
httpClientBuilder.connectTimeout(5,TimeUnit.SECONDS);
|
||||
// 设置读取超时时间
|
||||
httpClientBuilder.readTimeout(5,TimeUnit.SECONDS);
|
||||
httpClientBuilder.readTimeout(10,TimeUnit.SECONDS);
|
||||
// 设置连接池
|
||||
httpClientBuilder.connectionPool(new ConnectionPool(16, 5, TimeUnit.MINUTES));
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
|
|
@ -27,11 +27,10 @@ public final class JsonUtil {
|
|||
* @return result type
|
||||
*/
|
||||
public static <T> T redisJsonToObject(String key, Class<T> clazz) {
|
||||
JSONObject jsonObject = (JSONObject) RedisUtil.get(key);
|
||||
Object jsonObject = RedisUtil.get(key);
|
||||
if (Objects.isNull(jsonObject)) {
|
||||
return null;
|
||||
}
|
||||
return JSON.parseObject(jsonObject.toJSONString(), clazz);
|
||||
return clazz.cast(jsonObject);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue