diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/FileBuilder.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/FileBuilder.java index 2d9561486..a05de0ff9 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/FileBuilder.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/FileBuilder.java @@ -24,11 +24,11 @@ public final class FileBuilder extends BaseBuilder { /** * Media id file builder. * - * @param media_id the media id + * @param mediaId the media id * @return the file builder */ - public FileBuilder mediaId(String media_id) { - this.mediaId = media_id; + public FileBuilder mediaId(String mediaId) { + this.mediaId = mediaId; return this; } diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/live/WxMaLiveGoodInfo.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/live/WxMaLiveGoodInfo.java index e6f6c5609..e41665086 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/live/WxMaLiveGoodInfo.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/live/WxMaLiveGoodInfo.java @@ -26,7 +26,7 @@ public class WxMaLiveGoodInfo implements Serializable { */ private String thirdPartyTag; /** - * https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/liveplayer/pendant.html + * see here */ private List goodsKey; diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaPrivacyService.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaPrivacyService.java index 3180d0c32..e8f4665d8 100644 --- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaPrivacyService.java +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaPrivacyService.java @@ -4,9 +4,9 @@ import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.open.bean.ma.privacy.*; /** - * 微信第三方平台 小程序用户隐私保护指引接口 / 申请隐私接口(从2022年4月18日开始,部分小程序前端 api 需申请后,方可使用。该接口用于获取“需申请并审核通过”后才可使用的接口列表。) - * https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/privacy_config/set_privacy_setting.html - * https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/apply_api/get_privacy_interface.html + * 微信第三方平台 小程序用户隐私保护指引接口 / 申请隐私接口 + * (从2022年4月18日开始,部分小程序前端 api 需申请后,方可使用。该接口用于获取“需申请并审核通过”后才可使用的接口列表。) + * 配置小程序用户隐私保护指引获取接口列表 * * @author 广州跨界 */ @@ -37,10 +37,8 @@ public interface WxOpenMaPrivacyService { */ String APPLY_PRIVATE_INTERFACE = "https://api.weixin.qq.com/wxa/security/apply_privacy_interface"; - /** - * 查询小程序用户隐私保护指引 - * 文档地址:https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/privacy_config/get_privacy_setting.html + * 查询小程序用户隐私保护指引 * * @param privacyVer 1表示现网版本,即,传1则该接口返回的内容是现网版本的;2表示开发版,即,传2则该接口返回的内容是开发版本的。默认是2。 * @return 查询结果 @@ -48,22 +46,19 @@ public interface WxOpenMaPrivacyService { */ GetPrivacySettingResult getPrivacySetting(Integer privacyVer) throws WxErrorException; - /** - * 设置小程序用户隐私保护指引 - * 文档地址:https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/privacy_config/set_privacy_setting.html + * 设置小程序用户隐私保护指引 * * @param dto 参数对象 * @throws WxErrorException 如果出错,抛出此异常 */ void setPrivacySetting(SetPrivacySetting dto) throws WxErrorException; - /** * 上传小程序用户隐私保护指引文件 * 本接口用于上传自定义的小程序的用户隐私保护指引 * 仅限文本文件, 限制文件大小为不超过100kb,否则会报错 - * 文档地址:https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/privacy_config/upload_privacy_exfile.html + * 上传小程序用户隐私保护指引文件 * * @param content 文本文件内容 * @return 上传结果 @@ -71,22 +66,20 @@ public interface WxOpenMaPrivacyService { */ UploadPrivacyFileResult uploadPrivacyFile(String content) throws WxErrorException; - /** * 隐私接口-获取接口列表 * 从2022年4月18日开始,部分小程序前端 api 需申请后,方可使用。该接口用于获取“需申请并审核通过”后才可使用的接口列表。 - * 文档地址:https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/apply_api/get_privacy_interface.html + * 隐私接口-获取接口列表 * * @return 获取结果 * @throws WxErrorException 如果出错,抛出此异常 */ GetPrivacyInterfaceResult getPrivacyInterface() throws WxErrorException; - /** * 隐私接口-申请接口 * 从2022年4月18日开始,部分小程序前端 api 需申请后,方可使用。该接口用于获取“需申请并审核通过”后才可使用的接口列表。 - * 文档地址:https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/apply_api/get_privacy_interface.html + * 隐私接口-申请接口 * * @param dto 请求参数 * @return 获取结果 diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PartnerTransferServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PartnerTransferServiceImpl.java index 38e4276e8..ba1129718 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PartnerTransferServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PartnerTransferServiceImpl.java @@ -45,7 +45,8 @@ public class PartnerTransferServiceImpl implements PartnerTransferService { public PartnerTransferResult batchTransfer(PartnerTransferRequest request) throws WxPayException { request.getTransferDetailList().stream().forEach(p -> { try { - String userName = RsaCryptoUtil.encryptOAEP(p.getUserName(), this.payService.getConfig().getVerifier().getValidCertificate()); + String userName = RsaCryptoUtil.encryptOAEP(p.getUserName(), + this.payService.getConfig().getVerifier().getValidCertificate()); p.setUserName(userName); } catch (IllegalBlockSizeException e) { throw new RuntimeException("姓名转换异常!", e); @@ -61,7 +62,8 @@ public class PartnerTransferServiceImpl implements PartnerTransferService { * 接口说明 * 适用对象:服务商 * 请求URL:https://api.mch.weixin.qq.com/v3/partner-transfer/batches/batch-id/{batch_id} - * https://api.mch.weixin.qq.com/v3/partner-transfer/batches/batch-id/1030000071100999991182020050700019480001?need_query_detail=true&offset=1 + * https://api.mch.weixin.qq.com/v3/partner-transfer/batches/batch-id/1030000071100999991182020050700019480001 + * ?need_query_detail=true&offset=1 * 请求方式:GET * 接口限频:单个服务商 50QPS,如果超过频率限制,会报错FREQUENCY_LIMITED,请降低频率请求。 * @@ -71,16 +73,18 @@ public class PartnerTransferServiceImpl implements PartnerTransferService { */ @Override public BatchNumberResult queryBatchByBatchId(BatchNumberRequest request) throws WxPayException { - String url = String.format("%s/v3/partner-transfer/batches/batch-id/%s", this.payService.getPayBaseUrl(), request.getBatchId()); + String url = String.format("%s/v3/partner-transfer/batches/batch-id/%s", this.payService.getPayBaseUrl(), + request.getBatchId()); if (request.getOffset() == null) { request.setOffset(0); } if (request.getLimit() == null || request.getLimit() <= 0) { request.setLimit(20); } - String query = String.format("?need_query_detail=%s&detail_status=ALL&offset=%s&limit=%s", request.getNeedQueryDetail(), request.getOffset(), request.getLimit()); - if (StringUtil.isNotBlank(request.getDetailStatus())){ - query += "&detail_status="+request.getDetailStatus(); + String query = String.format("?need_query_detail=%s&detail_status=ALL&offset=%s&limit=%s", + request.getNeedQueryDetail(), request.getOffset(), request.getLimit()); + if (StringUtil.isNotBlank(request.getDetailStatus())) { + query += "&detail_status=" + request.getDetailStatus(); } String response = this.payService.getV3(url + query); return GSON.fromJson(response, BatchNumberResult.class); @@ -100,16 +104,18 @@ public class PartnerTransferServiceImpl implements PartnerTransferService { */ @Override public BatchNumberResult queryBatchByOutBatchNo(MerchantBatchRequest request) throws WxPayException { - String url = String.format("%s/v3/partner-transfer/batches/out-batch-no/%s", this.payService.getPayBaseUrl(), request.getOutBatchNo()); + String url = String.format("%s/v3/partner-transfer/batches/out-batch-no/%s", this.payService.getPayBaseUrl(), + request.getOutBatchNo()); if (request.getOffset() == null) { request.setOffset(0); } if (request.getLimit() == null || request.getLimit() <= 0) { request.setLimit(20); } - String query = String.format("?need_query_detail=%s&offset=%s&limit=%s", request.getNeedQueryDetail(), request.getOffset(), request.getLimit()); - if (StringUtil.isNotBlank(request.getDetailStatus())){ - query += "&detail_status="+request.getDetailStatus(); + String query = String.format("?need_query_detail=%s&offset=%s&limit=%s", request.getNeedQueryDetail(), + request.getOffset(), request.getLimit()); + if (StringUtil.isNotBlank(request.getDetailStatus())) { + query += "&detail_status=" + request.getDetailStatus(); } String response = this.payService.getV3(url + query); return GSON.fromJson(response, BatchNumberResult.class); @@ -130,11 +136,14 @@ public class PartnerTransferServiceImpl implements PartnerTransferService { * @throws BadPaddingException the wx decrypt exception */ @Override - public BatchDetailsResult queryBatchDetailByWeChat(String batchId, String detailId) throws WxPayException, BadPaddingException { - String url = String.format("%s/v3/partner-transfer/batches/batch-id/%s/details/detail-id/%s", this.payService.getPayBaseUrl(), batchId, detailId); + public BatchDetailsResult queryBatchDetailByWeChat(String batchId, String detailId) throws WxPayException, + BadPaddingException { + String url = String.format("%s/v3/partner-transfer/batches/batch-id/%s/details/detail-id/%s", + this.payService.getPayBaseUrl(), batchId, detailId); String response = this.payService.getV3(url); BatchDetailsResult batchDetailsResult = GSON.fromJson(response, BatchDetailsResult.class); - String userName = RsaCryptoUtil.decryptOAEP(batchDetailsResult.getUserName(), this.payService.getConfig().getPrivateKey()); + String userName = RsaCryptoUtil.decryptOAEP(batchDetailsResult.getUserName(), + this.payService.getConfig().getPrivateKey()); batchDetailsResult.setUserName(userName); return batchDetailsResult; } @@ -143,7 +152,8 @@ public class PartnerTransferServiceImpl implements PartnerTransferService { * 商家明细单号查询明细单API * 接口说明 * 适用对象:服务商 - * 请求URL:https://api.mch.weixin.qq.com/v3/partner-transfer/batches/out-batch-no/{out_batch_no}/details/out-detail-no/{out_detail_no} + * 请求URL:https://api.mch.weixin.qq.com/v3/partner-transfer/batches/out-batch-no/{out_batch_no}/details/out-detail + * -no/{out_detail_no} * 请求方式:GET * 接口限频:单个服务商 50QPS,如果超过频率限制,会报错FREQUENCY_LIMITED,请降低频率请求。 * @@ -154,11 +164,14 @@ public class PartnerTransferServiceImpl implements PartnerTransferService { * @throws BadPaddingException the wx decrypt exception */ @Override - public BatchDetailsResult queryBatchDetailByMch(String outBatchNo, String outDetailNo) throws WxPayException, BadPaddingException { - String url = String.format("%s/v3/partner-transfer/batches/out-batch-no/%s/details/out-detail-no/%s", this.payService.getPayBaseUrl(), outBatchNo, outDetailNo); + public BatchDetailsResult queryBatchDetailByMch(String outBatchNo, String outDetailNo) throws WxPayException, + BadPaddingException { + String url = String.format("%s/v3/partner-transfer/batches/out-batch-no/%s/details/out-detail-no/%s", + this.payService.getPayBaseUrl(), outBatchNo, outDetailNo); String response = this.payService.getV3(url); BatchDetailsResult batchDetailsResult = GSON.fromJson(response, BatchDetailsResult.class); - String userName = RsaCryptoUtil.decryptOAEP(batchDetailsResult.getUserName(), this.payService.getConfig().getPrivateKey()); + String userName = RsaCryptoUtil.decryptOAEP(batchDetailsResult.getUserName(), + this.payService.getConfig().getPrivateKey()); batchDetailsResult.setUserName(userName); return batchDetailsResult; } @@ -240,7 +253,8 @@ public class PartnerTransferServiceImpl implements PartnerTransferService { @Override public ElectronicReceiptsResult queryTransferElectronicResult(ElectronicReceiptsRequest request) throws WxPayException { String url = String.format("%s/v3/transfer-detail/electronic-receipts", this.payService.getPayBaseUrl()); - String query = String.format("?accept_type=%s&out_batch_no=%s&out_detail_no=%s", request.getAcceptType(), request.getOutBatchNo(), request.getOutDetailNo()); + String query = String.format("?accept_type=%s&out_batch_no=%s&out_detail_no=%s", request.getAcceptType(), + request.getOutBatchNo(), request.getOutDetailNo()); String response = this.payService.getV3(url + query); return GSON.fromJson(response, ElectronicReceiptsResult.class); }