Merge pull request #739 from xiaoQQya/wvp-28181-2.0
序列化问题修复与代码优化
| | |
| | | // 设置连接超时时间 |
| | | 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()) { |
| | |
| | | * @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); |
| | | } |
| | | |
| | | } |