refactor: Update pathParams

This commit is contained in:
felord
2021-06-05 13:28:37 +08:00
parent 53a34e6a71
commit 60fe80e615
2 changed files with 13 additions and 13 deletions

View File

@@ -140,13 +140,13 @@ public class WechatBatchTransferApi extends AbstractApi {
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
this.client().withType(WechatPayV3Type.BATCH_TRANSFER_DETAIL_WECHAT, queryBatchTransferDetailParams)
.function((type, params) -> {
Map<String, String> queryParams = new HashMap<>(2);
queryParams.put("batch_id", params.getBatchIdOrOutBatchNo());
queryParams.put("detail_id", params.getDetailIdOrOutDetailNo());
Map<String, String> pathParams = new HashMap<>(2);
pathParams.put("batch_id", params.getBatchIdOrOutBatchNo());
pathParams.put("detail_id", params.getDetailIdOrOutDetailNo());
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
.build()
.expand(queryParams)
.expand(pathParams)
.toUri();
return Get(uri);
})
@@ -195,13 +195,13 @@ public class WechatBatchTransferApi extends AbstractApi {
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
this.client().withType(WechatPayV3Type.BATCH_TRANSFER_DETAIL_MCH, queryBatchTransferDetailParams)
.function((type, params) -> {
Map<String, String> queryParams = new HashMap<>(2);
queryParams.put("batch_id", params.getBatchIdOrOutBatchNo());
queryParams.put("detail_id", params.getDetailIdOrOutDetailNo());
Map<String, String> pathParams = new HashMap<>(2);
pathParams.put("batch_id", params.getBatchIdOrOutBatchNo());
pathParams.put("detail_id", params.getDetailIdOrOutDetailNo());
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
.build()
.expand(queryParams)
.expand(pathParams)
.toUri();
return Get(uri);
})

View File

@@ -65,14 +65,14 @@ public class WechatPayScoreApi extends AbstractApi {
.function((wechatPayV3Type, userServiceStateParams) -> {
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
Map<String, String> expandParams = new HashMap<>(3);
expandParams.put("appid", v3.getAppId());
expandParams.put("service_id", params.getServiceId());
expandParams.put("openid", params.getOpenId());
Map<String, String> pathParams = new HashMap<>(3);
pathParams.put("appid", v3.getAppId());
pathParams.put("service_id", params.getServiceId());
pathParams.put("openid", params.getOpenId());
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
.build()
.expand(expandParams)
.expand(pathParams)
.toUri();
return Get(uri);
})