|
1 | 1 | package cn.binarywang.wx.miniapp.api.impl;
|
2 | 2 |
|
3 |
| -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_ADD_URL; |
4 |
| -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_DELISTING_URL; |
5 |
| -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_DEL_URL; |
6 |
| -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_GET_LIST_URL; |
7 |
| -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_GET_URL; |
8 |
| -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_LISTING_URL; |
9 |
| -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_UPDATE_URL; |
10 |
| -import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.SPU_UPDATE_WITHOUT_URL; |
11 |
| - |
12 | 3 | import cn.binarywang.wx.miniapp.api.WxMaService;
|
13 | 4 | import cn.binarywang.wx.miniapp.api.WxMaShopSpuService;
|
14 | 5 | import cn.binarywang.wx.miniapp.bean.shop.WxMaShopSpuInfo;
|
|
28 | 19 | import me.chanjar.weixin.common.util.json.GsonHelper;
|
29 | 20 | import me.chanjar.weixin.common.util.json.GsonParser;
|
30 | 21 |
|
| 22 | +import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.*; |
| 23 | + |
31 | 24 | /**
|
32 | 25 | * @author boris
|
33 | 26 | */
|
@@ -131,4 +124,17 @@ public WxMaShopBaseResponse delistingSpu(Integer productId, String outProductId)
|
131 | 124 | }
|
132 | 125 | return WxMaGsonBuilder.create().fromJson(responseContent, WxMaShopBaseResponse.class);
|
133 | 126 | }
|
| 127 | + |
| 128 | + @Override |
| 129 | + public WxMaShopBaseResponse deleteAudit(Integer productId, String outProductId) |
| 130 | + throws WxErrorException { |
| 131 | + String responseContent = this.wxMaService |
| 132 | + .post(DEL_AUDIT_URL, GsonHelper.buildJsonObject("product_id", productId, |
| 133 | + "out_product_id", outProductId)); |
| 134 | + JsonObject jsonObject = GsonParser.parse(responseContent); |
| 135 | + if (jsonObject.get(ERR_CODE).getAsInt() != 0) { |
| 136 | + throw new WxErrorException(WxError.fromJson(responseContent, WxType.MiniApp)); |
| 137 | + } |
| 138 | + return WxMaGsonBuilder.create().fromJson(responseContent, WxMaShopBaseResponse.class); |
| 139 | + } |
134 | 140 | }
|
0 commit comments