From 17c170a704a62a0bf75117d5c315ac3986443e2d Mon Sep 17 00:00:00 2001 From: shienpro <19704239+shienpro@users.noreply.github.com> Date: Tue, 17 Aug 2021 10:48:00 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=B0=8F=E7=A8=8B=E5=BA=8F=E3=80=91?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=92=A4=E9=94=80=E5=95=86=E5=93=81=E5=AE=A1=E6=A0=B8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wx/miniapp/api/WxMaShopSpuService.java | 3 +++ .../api/impl/WxMaShopSpuServiceImpl.java | 24 ++++++++++++------- .../miniapp/constant/WxMaApiUrlConstants.java | 1 + 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaShopSpuService.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaShopSpuService.java index 183d239670..c896f7eaf5 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaShopSpuService.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaShopSpuService.java @@ -35,4 +35,7 @@ WxMaShopBaseResponse listingSpu(Integer productId, String outProductId) WxMaShopBaseResponse delistingSpu(Integer productId, String outProductId) throws WxErrorException; + + WxMaShopBaseResponse deleteAudit(Integer productId, String outProductId) + throws WxErrorException; } diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaShopSpuServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaShopSpuServiceImpl.java index 4be695a075..94b779c6c9 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaShopSpuServiceImpl.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaShopSpuServiceImpl.java @@ -1,14 +1,5 @@ package cn.binarywang.wx.miniapp.api.impl; -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_ADD_URL; -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_DELISTING_URL; -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_DEL_URL; -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_GET_LIST_URL; -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_GET_URL; -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_LISTING_URL; -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_UPDATE_URL; -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_UPDATE_WITHOUT_URL; - import cn.binarywang.wx.miniapp.api.WxMaService; import cn.binarywang.wx.miniapp.api.WxMaShopSpuService; import cn.binarywang.wx.miniapp.bean.shop.WxMaShopSpuInfo; @@ -28,6 +19,8 @@ import me.chanjar.weixin.common.util.json.GsonHelper; import me.chanjar.weixin.common.util.json.GsonParser; +import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.*; + /** * @author boris */ @@ -131,4 +124,17 @@ public WxMaShopBaseResponse delistingSpu(Integer productId, String outProductId) } return WxMaGsonBuilder.create().fromJson(responseContent, WxMaShopBaseResponse.class); } + + @Override + public WxMaShopBaseResponse deleteAudit(Integer productId, String outProductId) + throws WxErrorException { + String responseContent = this.wxMaService + .post(DEL_AUDIT_URL, GsonHelper.buildJsonObject("product_id", productId, + "out_product_id", outProductId)); + JsonObject jsonObject = GsonParser.parse(responseContent); + if (jsonObject.get(ERR_CODE).getAsInt() != 0) { + throw new WxErrorException(WxError.fromJson(responseContent, WxType.MiniApp)); + } + return WxMaGsonBuilder.create().fromJson(responseContent, WxMaShopBaseResponse.class); + } } diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java index 28a38a1f20..f65fceaaa8 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java @@ -311,6 +311,7 @@ interface Spu { String SPU_UPDATE_WITHOUT_URL = "https://api.weixin.qq.com/shop/spu/update_without_audit"; String SPU_LISTING_URL = "https://api.weixin.qq.com/shop/spu/listing"; String SPU_DELISTING_URL = "https://api.weixin.qq.com/shop/spu/delisting"; + String DEL_AUDIT_URL = "https://api.weixin.qq.com/shop/spu/del_audit"; } interface Order {