批量格式化代码

This commit is contained in:
Binary Wang 2017-05-11 17:07:32 +08:00
parent 8982cf8471
commit 1806389a4d
18 changed files with 110 additions and 133 deletions

View File

@ -8,7 +8,6 @@ import me.chanjar.weixin.common.util.http.HttpType;
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder; import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
import me.chanjar.weixin.common.util.http.apache.DefaultApacheHttpClientBuilder; import me.chanjar.weixin.common.util.http.apache.DefaultApacheHttpClientBuilder;
import me.chanjar.weixin.cp.api.WxCpConfigStorage; import me.chanjar.weixin.cp.api.WxCpConfigStorage;
import me.chanjar.weixin.cp.api.impl.AbstractWxCpServiceImpl; import me.chanjar.weixin.cp.api.impl.AbstractWxCpServiceImpl;
import org.apache.http.HttpHost; import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig; import org.apache.http.client.config.RequestConfig;

View File

@ -1,24 +1,15 @@
package me.chanjar.weixin.mp.api.impl.apache; package me.chanjar.weixin.mp.api.impl.apache;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import me.chanjar.weixin.common.bean.WxAccessToken; import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.common.bean.result.WxError; import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException; import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.session.StandardSessionManager; import me.chanjar.weixin.common.util.http.HttpType;
import me.chanjar.weixin.common.session.WxSessionManager; import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.RandomUtils;
import me.chanjar.weixin.common.util.crypto.SHA1;
import me.chanjar.weixin.common.util.http.*;
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder; import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
import me.chanjar.weixin.common.util.http.apache.DefaultApacheHttpClientBuilder; import me.chanjar.weixin.common.util.http.apache.DefaultApacheHttpClientBuilder;
import me.chanjar.weixin.mp.api.*; import me.chanjar.weixin.mp.api.WxMpConfigStorage;
import me.chanjar.weixin.mp.api.impl.*; import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.*; import me.chanjar.weixin.mp.api.impl.AbstractWxMpServiceImpl;
import me.chanjar.weixin.mp.bean.result.*;
import org.apache.http.HttpHost; import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig; import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.CloseableHttpResponse;

View File

@ -7,8 +7,9 @@ import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException; import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.util.http.HttpType; import me.chanjar.weixin.common.util.http.HttpType;
import me.chanjar.weixin.common.util.http.RequestHttp; import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.mp.api.*; import me.chanjar.weixin.mp.api.WxMpConfigStorage;
import me.chanjar.weixin.mp.api.impl.*; import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.AbstractWxMpServiceImpl;
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.Lock;

View File

@ -1,12 +1,10 @@
package me.chanjar.weixin.mp.bean.kefu.request; package me.chanjar.weixin.mp.bean.kefu.request;
import java.io.Serializable; import com.google.gson.annotations.SerializedName;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import com.google.gson.annotations.SerializedName; import java.io.Serializable;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
public class WxMpKfAccountRequest implements Serializable { public class WxMpKfAccountRequest implements Serializable {
private static final long serialVersionUID = -5451863610674856927L; private static final long serialVersionUID = -5451863610674856927L;
@ -29,6 +27,10 @@ public class WxMpKfAccountRequest implements Serializable {
@SerializedName("invite_wx") @SerializedName("invite_wx")
private String inviteWx; private String inviteWx;
public static Builder builder() {
return new Builder();
}
@Override @Override
public String toString() { public String toString() {
return ToStringBuilder.reflectionToString(this); return ToStringBuilder.reflectionToString(this);
@ -54,10 +56,6 @@ public class WxMpKfAccountRequest implements Serializable {
this.nickName = nickName; this.nickName = nickName;
} }
public static Builder builder() {
return new Builder();
}
public String getInviteWx() { public String getInviteWx() {
return this.inviteWx; return this.inviteWx;
} }

View File

@ -1,7 +1,5 @@
package me.chanjar.weixin.mp.util.http.jodd; package me.chanjar.weixin.mp.util.http.jodd;
import java.io.IOException;
import jodd.http.HttpConnectionProvider; import jodd.http.HttpConnectionProvider;
import jodd.http.HttpRequest; import jodd.http.HttpRequest;
import jodd.http.HttpResponse; import jodd.http.HttpResponse;
@ -11,6 +9,8 @@ import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp; import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.mp.util.http.MaterialDeleteRequestExecutor; import me.chanjar.weixin.mp.util.http.MaterialDeleteRequestExecutor;
import java.io.IOException;
/** /**
* Created by ecoolper on 2017/5/5. * Created by ecoolper on 2017/5/5.
*/ */

View File

@ -1,7 +1,5 @@
package me.chanjar.weixin.mp.util.http.jodd; package me.chanjar.weixin.mp.util.http.jodd;
import java.io.IOException;
import jodd.http.HttpConnectionProvider; import jodd.http.HttpConnectionProvider;
import jodd.http.HttpRequest; import jodd.http.HttpRequest;
import jodd.http.HttpResponse; import jodd.http.HttpResponse;
@ -13,6 +11,8 @@ import me.chanjar.weixin.mp.bean.material.WxMpMaterialNews;
import me.chanjar.weixin.mp.util.http.MaterialNewsInfoRequestExecutor; import me.chanjar.weixin.mp.util.http.MaterialNewsInfoRequestExecutor;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder; import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
import java.io.IOException;
/** /**
* Created by ecoolper on 2017/5/5. * Created by ecoolper on 2017/5/5.
*/ */

View File

@ -1,10 +1,5 @@
package me.chanjar.weixin.mp.util.http.jodd; package me.chanjar.weixin.mp.util.http.jodd;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Map;
import jodd.http.HttpConnectionProvider; import jodd.http.HttpConnectionProvider;
import jodd.http.HttpRequest; import jodd.http.HttpRequest;
import jodd.http.HttpResponse; import jodd.http.HttpResponse;
@ -17,6 +12,11 @@ import me.chanjar.weixin.mp.bean.material.WxMpMaterial;
import me.chanjar.weixin.mp.bean.material.WxMpMaterialUploadResult; import me.chanjar.weixin.mp.bean.material.WxMpMaterialUploadResult;
import me.chanjar.weixin.mp.util.http.MaterialUploadRequestExecutor; import me.chanjar.weixin.mp.util.http.MaterialUploadRequestExecutor;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Map;
/** /**
* Created by ecoolper on 2017/5/5. * Created by ecoolper on 2017/5/5.
*/ */

View File

@ -1,7 +1,5 @@
package me.chanjar.weixin.mp.util.http.jodd; package me.chanjar.weixin.mp.util.http.jodd;
import java.io.IOException;
import jodd.http.HttpConnectionProvider; import jodd.http.HttpConnectionProvider;
import jodd.http.HttpRequest; import jodd.http.HttpRequest;
import jodd.http.HttpResponse; import jodd.http.HttpResponse;
@ -12,6 +10,8 @@ import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.mp.bean.material.WxMpMaterialVideoInfoResult; import me.chanjar.weixin.mp.bean.material.WxMpMaterialVideoInfoResult;
import me.chanjar.weixin.mp.util.http.MaterialVideoInfoRequestExecutor; import me.chanjar.weixin.mp.util.http.MaterialVideoInfoRequestExecutor;
import java.io.IOException;
/** /**
* Created by ecoolper on 2017/5/5. * Created by ecoolper on 2017/5/5.
*/ */

View File

@ -1,12 +1,5 @@
package me.chanjar.weixin.mp.util.http.jodd; package me.chanjar.weixin.mp.util.http.jodd;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
import jodd.http.HttpConnectionProvider; import jodd.http.HttpConnectionProvider;
import jodd.http.HttpRequest; import jodd.http.HttpRequest;
import jodd.http.HttpResponse; import jodd.http.HttpResponse;
@ -16,7 +9,12 @@ import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp; import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.json.WxGsonBuilder; import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import me.chanjar.weixin.mp.util.http.MaterialVoiceAndImageDownloadRequestExecutor; import me.chanjar.weixin.mp.util.http.MaterialVoiceAndImageDownloadRequestExecutor;
import me.chanjar.weixin.mp.util.http.okhttp.OkhttpMaterialVoiceAndImageDownloadRequestExecutor; import org.apache.commons.io.IOUtils;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
/** /**
* Created by ecoolper on 2017/5/5. * Created by ecoolper on 2017/5/5.

View File

@ -1,8 +1,5 @@
package me.chanjar.weixin.mp.util.http.jodd; package me.chanjar.weixin.mp.util.http.jodd;
import java.io.File;
import java.io.IOException;
import jodd.http.HttpConnectionProvider; import jodd.http.HttpConnectionProvider;
import jodd.http.HttpRequest; import jodd.http.HttpRequest;
import jodd.http.HttpResponse; import jodd.http.HttpResponse;
@ -13,6 +10,9 @@ import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.mp.bean.material.WxMediaImgUploadResult; import me.chanjar.weixin.mp.bean.material.WxMediaImgUploadResult;
import me.chanjar.weixin.mp.util.http.MediaImgUploadRequestExecutor; import me.chanjar.weixin.mp.util.http.MediaImgUploadRequestExecutor;
import java.io.File;
import java.io.IOException;
/** /**
* Created by ecoolper on 2017/5/5. * Created by ecoolper on 2017/5/5.
*/ */

View File

@ -1,12 +1,5 @@
package me.chanjar.weixin.mp.util.http.jodd; package me.chanjar.weixin.mp.util.http.jodd;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.UUID;
import jodd.http.HttpConnectionProvider; import jodd.http.HttpConnectionProvider;
import jodd.http.HttpRequest; import jodd.http.HttpRequest;
import jodd.http.HttpResponse; import jodd.http.HttpResponse;
@ -19,6 +12,13 @@ import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket; import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket;
import me.chanjar.weixin.mp.util.http.QrCodeRequestExecutor; import me.chanjar.weixin.mp.util.http.QrCodeRequestExecutor;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.UUID;
/** /**
* Created by ecoolper on 2017/5/5. * Created by ecoolper on 2017/5/5.
*/ */

View File

@ -1,15 +1,14 @@
package me.chanjar.weixin.mp.util.http.okhttp; package me.chanjar.weixin.mp.util.http.okhttp;
import java.io.IOException;
import me.chanjar.weixin.common.bean.result.WxError; import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException; import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestExecutor;
import me.chanjar.weixin.common.util.http.RequestHttp; import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.http.okhttp.OkhttpProxyInfo; import me.chanjar.weixin.common.util.http.okhttp.OkhttpProxyInfo;
import me.chanjar.weixin.mp.util.http.MaterialDeleteRequestExecutor; import me.chanjar.weixin.mp.util.http.MaterialDeleteRequestExecutor;
import okhttp3.*; import okhttp3.*;
import java.io.IOException;
/** /**
* Created by ecoolper on 2017/5/5. * Created by ecoolper on 2017/5/5.
*/ */

View File

@ -1,7 +1,5 @@
package me.chanjar.weixin.mp.util.http.okhttp; package me.chanjar.weixin.mp.util.http.okhttp;
import java.io.IOException;
import me.chanjar.weixin.common.bean.result.WxError; import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException; import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp; import me.chanjar.weixin.common.util.http.RequestHttp;
@ -11,6 +9,8 @@ import me.chanjar.weixin.mp.util.http.MaterialNewsInfoRequestExecutor;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder; import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
import okhttp3.*; import okhttp3.*;
import java.io.IOException;
/** /**
* Created by ecoolper on 2017/5/5. * Created by ecoolper on 2017/5/5.
*/ */

View File

@ -1,21 +1,8 @@
package me.chanjar.weixin.mp.util.http.okhttp; package me.chanjar.weixin.mp.util.http.okhttp;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Map;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.HttpMultipartMode;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import me.chanjar.weixin.common.bean.result.WxError; import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException; import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp; import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.http.apache.Utf8ResponseHandler;
import me.chanjar.weixin.common.util.http.okhttp.OkhttpProxyInfo; import me.chanjar.weixin.common.util.http.okhttp.OkhttpProxyInfo;
import me.chanjar.weixin.common.util.json.WxGsonBuilder; import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import me.chanjar.weixin.mp.bean.material.WxMpMaterial; import me.chanjar.weixin.mp.bean.material.WxMpMaterial;
@ -23,6 +10,11 @@ import me.chanjar.weixin.mp.bean.material.WxMpMaterialUploadResult;
import me.chanjar.weixin.mp.util.http.MaterialUploadRequestExecutor; import me.chanjar.weixin.mp.util.http.MaterialUploadRequestExecutor;
import okhttp3.*; import okhttp3.*;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Map;
/** /**
* Created by ecoolper on 2017/5/5. * Created by ecoolper on 2017/5/5.
*/ */

View File

@ -1,7 +1,5 @@
package me.chanjar.weixin.mp.util.http.okhttp; package me.chanjar.weixin.mp.util.http.okhttp;
import java.io.IOException;
import me.chanjar.weixin.common.bean.result.WxError; import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException; import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp; import me.chanjar.weixin.common.util.http.RequestHttp;
@ -10,6 +8,8 @@ import me.chanjar.weixin.mp.bean.material.WxMpMaterialVideoInfoResult;
import me.chanjar.weixin.mp.util.http.MaterialVideoInfoRequestExecutor; import me.chanjar.weixin.mp.util.http.MaterialVideoInfoRequestExecutor;
import okhttp3.*; import okhttp3.*;
import java.io.IOException;
/** /**
* Created by ecoolper on 2017/5/5. * Created by ecoolper on 2017/5/5.
*/ */

View File

@ -1,12 +1,5 @@
package me.chanjar.weixin.mp.util.http.okhttp; package me.chanjar.weixin.mp.util.http.okhttp;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
import me.chanjar.weixin.common.bean.result.WxError; import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException; import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp; import me.chanjar.weixin.common.util.http.RequestHttp;
@ -14,6 +7,12 @@ import me.chanjar.weixin.common.util.http.okhttp.OkhttpProxyInfo;
import me.chanjar.weixin.common.util.json.WxGsonBuilder; import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import me.chanjar.weixin.mp.util.http.MaterialVoiceAndImageDownloadRequestExecutor; import me.chanjar.weixin.mp.util.http.MaterialVoiceAndImageDownloadRequestExecutor;
import okhttp3.*; import okhttp3.*;
import org.apache.commons.io.IOUtils;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
/** /**
* Created by ecoolper on 2017/5/5. * Created by ecoolper on 2017/5/5.

View File

@ -1,8 +1,5 @@
package me.chanjar.weixin.mp.util.http.okhttp; package me.chanjar.weixin.mp.util.http.okhttp;
import java.io.File;
import java.io.IOException;
import me.chanjar.weixin.common.bean.result.WxError; import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException; import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp; import me.chanjar.weixin.common.util.http.RequestHttp;
@ -11,6 +8,9 @@ import me.chanjar.weixin.mp.bean.material.WxMediaImgUploadResult;
import me.chanjar.weixin.mp.util.http.MediaImgUploadRequestExecutor; import me.chanjar.weixin.mp.util.http.MediaImgUploadRequestExecutor;
import okhttp3.*; import okhttp3.*;
import java.io.File;
import java.io.IOException;
/** /**
* Created by ecoolper on 2017/5/5. * Created by ecoolper on 2017/5/5.
*/ */

View File

@ -1,11 +1,5 @@
package me.chanjar.weixin.mp.util.http.okhttp; package me.chanjar.weixin.mp.util.http.okhttp;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.UUID;
import jodd.util.MimeTypes; import jodd.util.MimeTypes;
import me.chanjar.weixin.common.bean.result.WxError; import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException; import me.chanjar.weixin.common.exception.WxErrorException;
@ -16,6 +10,12 @@ import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket;
import me.chanjar.weixin.mp.util.http.QrCodeRequestExecutor; import me.chanjar.weixin.mp.util.http.QrCodeRequestExecutor;
import okhttp3.*; import okhttp3.*;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.UUID;
/** /**
* Created by ecoolper on 2017/5/5. * Created by ecoolper on 2017/5/5.
*/ */