factor: 商家券修改API的请求方法改为Patch

This commit is contained in:
felord
2021-03-26 09:30:01 +08:00
parent 53e6016c4c
commit ee5522e980
4 changed files with 28 additions and 3 deletions

View File

@@ -431,7 +431,7 @@ public enum WechatPayV3Type {
*
* @since 1.0.4.RELEASES
*/
MARKETING_BUSI_FAVOR_UPDATE(HttpMethod.POST, "%s/v3/marketing/busifavor/stocks/{stock_id}"),
MARKETING_BUSI_FAVOR_UPDATE(HttpMethod.PATCH, "%s/v3/marketing/busifavor/stocks/{stock_id}"),
/**
* 申请退券API.
*

View File

@@ -202,6 +202,21 @@ public abstract class AbstractApi {
.build();
}
/**
* 构建Post请求对象.
*
* @param uri the uri
* @param params the params
* @return the request entity
*/
protected RequestEntity<?> Patch(URI uri, Object params) {
try {
return RequestEntity.patch(uri).header("Pay-TenantId", tenantId)
.body(mapper.writeValueAsString(params));
} catch (JsonProcessingException e) {
throw new PayException("wechat app pay json failed");
}
}
/**
* 对账单内容下载,非流文件。
*

View File

@@ -384,7 +384,7 @@ public class WechatMarketingBusiFavorApi extends AbstractApi {
.expand(updateParams.getStockId())
.toUri();
updateParams.setStockId(null);
return Post(uri, updateParams);
return Patch(uri, updateParams);
})
.consumer(wechatResponseEntity::convert)
.request();