使用lombok的@Data注解简化common模块的所有bean类

This commit is contained in:
Binary Wang
2017-11-14 11:05:18 +08:00
parent e007a13df6
commit 993999735b
48 changed files with 131 additions and 426 deletions

View File

@@ -9,7 +9,8 @@ import me.chanjar.weixin.mp.util.http.okhttp.OkhttpMaterialVoiceAndImageDownload
import java.io.File;
import java.io.InputStream;
public abstract class MaterialVoiceAndImageDownloadRequestExecutor<H, P> implements RequestExecutor<InputStream, String> {
public abstract class MaterialVoiceAndImageDownloadRequestExecutor<H, P>
implements RequestExecutor<InputStream, String> {
protected RequestHttp<H, P> requestHttp;
protected File tmpDirFile;

View File

@@ -32,7 +32,7 @@ public abstract class QrCodeRequestExecutor<H, P> implements RequestExecutor<Fil
case OK_HTTP:
return new OkhttpQrCodeRequestExecutor(requestHttp);
default:
throw new WxErrorException(WxError.newBuilder().setErrorMsg("不支持的http框架").build());
throw new WxErrorException(WxError.builder().errorCode(-1).errorMsg("不支持的http框架").build());
}
}

View File

@@ -41,7 +41,7 @@ public class ApacheMaterialUploadRequestExecutor extends MaterialUploadRequestEx
}
if (material == null) {
throw new WxErrorException(WxError.newBuilder().setErrorMsg("非法请求material参数为空").build());
throw new WxErrorException(WxError.builder().errorCode(-1).errorMsg("非法请求material参数为空").build());
}
File file = material.getFile();

View File

@@ -30,7 +30,7 @@ public class ApacheMediaImgUploadRequestExecutor extends MediaImgUploadRequestEx
@Override
public WxMediaImgUploadResult execute(String uri, File data) throws WxErrorException, IOException {
if (data == null) {
throw new WxErrorException(WxError.newBuilder().setErrorMsg("文件对象为空").build());
throw new WxErrorException(WxError.builder().errorCode(-1).errorMsg("文件对象为空").build());
}
HttpPost httpPost = new HttpPost(uri);

View File

@@ -36,7 +36,7 @@ public class JoddMaterialUploadRequestExecutor extends MaterialUploadRequestExec
request.withConnectionProvider(requestHttp.getRequestHttpClient());
if (material == null) {
throw new WxErrorException(WxError.newBuilder().setErrorMsg("非法请求material参数为空").build());
throw new WxErrorException(WxError.builder().errorCode(-1).errorMsg("非法请求material参数为空").build());
}
File file = material.getFile();

View File

@@ -26,7 +26,7 @@ public class JoddMediaImgUploadRequestExecutor extends MediaImgUploadRequestExec
@Override
public WxMediaImgUploadResult execute(String uri, File data) throws WxErrorException, IOException {
if (data == null) {
throw new WxErrorException(WxError.newBuilder().setErrorMsg("文件对象为空").build());
throw new WxErrorException(WxError.builder().errorCode(-1).errorMsg("文件对象为空").build());
}
HttpRequest request = HttpRequest.post(uri);

View File

@@ -31,7 +31,7 @@ public class OkhttpMaterialUploadRequestExecutor extends MaterialUploadRequestEx
public WxMpMaterialUploadResult execute(String uri, WxMpMaterial material) throws WxErrorException, IOException {
logger.debug("OkhttpMaterialUploadRequestExecutor is running");
if (material == null) {
throw new WxErrorException(WxError.newBuilder().setErrorMsg("非法请求material参数为空").build());
throw new WxErrorException(WxError.builder().errorCode(-1).errorMsg("非法请求material参数为空").build());
}
File file = material.getFile();
if (file == null || !file.exists()) {