客服聊天记录接口&resolveHttpparams rename to setDefaultParams
This commit is contained in:
+4
-4
@@ -102,7 +102,7 @@ public abstract class HttpClientFactory {
|
||||
*/
|
||||
public static HttpClient getInstance(HttpParams params) {
|
||||
HttpClientFactory clientFactory = getDefaultFactory();
|
||||
clientFactory.resolveHttpParams(params);
|
||||
clientFactory.setDefaultParams(params);
|
||||
return clientFactory.newInstance();
|
||||
}
|
||||
|
||||
@@ -112,11 +112,11 @@ public abstract class HttpClientFactory {
|
||||
* @param params
|
||||
* 请求参数
|
||||
*/
|
||||
public void resolveHttpParams(HttpParams params) {
|
||||
public void setDefaultParams(HttpParams params) {
|
||||
if (params == null) {
|
||||
throw new IllegalArgumentException("'params' must not be empty");
|
||||
}
|
||||
resolveHttpParams0(params);
|
||||
resolveHttpParams(params);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,7 +125,7 @@ public abstract class HttpClientFactory {
|
||||
* @param params
|
||||
* 请求参数
|
||||
*/
|
||||
protected abstract void resolveHttpParams0(HttpParams params);
|
||||
protected abstract void resolveHttpParams(HttpParams params);
|
||||
|
||||
/**
|
||||
* 获取HttpClient实例
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ public class SimpleHttpClientFactory extends HttpClientFactory {
|
||||
private HttpParams params;
|
||||
|
||||
@Override
|
||||
protected void resolveHttpParams0(HttpParams params) {
|
||||
protected void resolveHttpParams(HttpParams params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class HttpComponent3Factory extends HttpClientFactory {
|
||||
* Resolve Parameter
|
||||
*/
|
||||
@Override
|
||||
protected void resolveHttpParams0(HttpParams params) {
|
||||
protected void resolveHttpParams(HttpParams params) {
|
||||
if (params.getProxy() != null) {
|
||||
InetSocketAddress socketAddress = (InetSocketAddress) params
|
||||
.getProxy().address();
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@ public class HttpComponent4Factory extends HttpClientFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void resolveHttpParams0(HttpParams params) {
|
||||
httpComponentFactory.resolveHttpParams(params);
|
||||
protected void resolveHttpParams(HttpParams params) {
|
||||
httpComponentFactory.setDefaultParams(params);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class HttpComponent4_1Factory extends HttpClientFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void resolveHttpParams0(HttpParams params) {
|
||||
protected void resolveHttpParams(HttpParams params) {
|
||||
if (params == null) {
|
||||
throw new IllegalArgumentException("'params' must not be empty");
|
||||
}
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class HttpComponent4_2Factory extends HttpClientFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resolveHttpParams0(HttpParams params) {
|
||||
public void resolveHttpParams(HttpParams params) {
|
||||
clientBuilder.setDefaultRequestConfig(RequestConfig.custom()
|
||||
.setConnectTimeout(params.getConnectTimeout())
|
||||
.setConnectionRequestTimeout(params.getReadTimeout()).build());
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ public class Netty4HttpClientFactory extends HttpClientFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void resolveHttpParams0(HttpParams params) {
|
||||
protected void resolveHttpParams(HttpParams params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ public class OkHttpClient2Factory extends HttpClientFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void resolveHttpParams0(HttpParams params) {
|
||||
protected void resolveHttpParams(HttpParams params) {
|
||||
okClient.setConnectTimeout(params.getConnectTimeout(),
|
||||
TimeUnit.MILLISECONDS);
|
||||
okClient.setReadTimeout(params.getReadTimeout(), TimeUnit.MILLISECONDS);
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class OkHttpClient3Factory extends HttpClientFactory {
|
||||
*
|
||||
* */
|
||||
@Override
|
||||
protected void resolveHttpParams0(HttpParams params) {
|
||||
protected void resolveHttpParams(HttpParams params) {
|
||||
clientBuilder.connectTimeout(params.getConnectTimeout(),
|
||||
TimeUnit.MILLISECONDS);
|
||||
clientBuilder.readTimeout(params.getReadTimeout(),
|
||||
|
||||
+2
-2
@@ -27,8 +27,8 @@ public class OkHttpClientFactory extends HttpClientFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void resolveHttpParams0(HttpParams params) {
|
||||
okHttpClientFactory.resolveHttpParams(params);
|
||||
protected void resolveHttpParams(HttpParams params) {
|
||||
okHttpClientFactory.setDefaultParams(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,7 +45,7 @@ public class MediaRecord implements Serializable {
|
||||
@JSONField(serialize = false, deserialize = false)
|
||||
private Pageable pageable;
|
||||
@JSONField(serialize = false, deserialize = false)
|
||||
private Pagedata<MediaItem> pagedata;
|
||||
private volatile Pagedata<MediaItem> pagedata;
|
||||
|
||||
public int getTotalCount() {
|
||||
return totalCount;
|
||||
|
||||
@@ -94,7 +94,7 @@ public class Pageable implements Serializable {
|
||||
}
|
||||
|
||||
public Pageable first() {
|
||||
return new Pageable(0, getPageSize(), getSort());
|
||||
return new Pageable(1, getPageSize(), getSort());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -79,7 +79,7 @@ public class DateUtil {
|
||||
public static String formatFee2Fen(double fee) {
|
||||
BigDecimal _fee = new BigDecimal(Double.toString(fee));
|
||||
fee = _fee.multiply(new BigDecimal("100"))
|
||||
.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
|
||||
return new DecimalFormat("#").format(fee);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public abstract class HttpClientTest {
|
||||
|
||||
protected HttpClient createHttpClient(HttpParams params) {
|
||||
HttpClientFactory httpClientFactory = createHttpFactory();
|
||||
httpClientFactory.resolveHttpParams(params);
|
||||
httpClientFactory.setDefaultParams(params);
|
||||
return httpClientFactory.newInstance();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user