Skip to content

Commit 28b2ca9

Browse files
authored
🆕 #2260【小程序】增加自定义组件之撤销商品审核的接口
1 parent 614a1c9 commit 28b2ca9

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaShopSpuService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,7 @@ WxMaShopBaseResponse listingSpu(Integer productId, String outProductId)
3535

3636
WxMaShopBaseResponse delistingSpu(Integer productId, String outProductId)
3737
throws WxErrorException;
38+
39+
WxMaShopBaseResponse deleteAudit(Integer productId, String outProductId)
40+
throws WxErrorException;
3841
}

weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaShopSpuServiceImpl.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
package cn.binarywang.wx.miniapp.api.impl;
22

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-
123
import cn.binarywang.wx.miniapp.api.WxMaService;
134
import cn.binarywang.wx.miniapp.api.WxMaShopSpuService;
145
import cn.binarywang.wx.miniapp.bean.shop.WxMaShopSpuInfo;
@@ -28,6 +19,8 @@
2819
import me.chanjar.weixin.common.util.json.GsonHelper;
2920
import me.chanjar.weixin.common.util.json.GsonParser;
3021

22+
import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Spu.*;
23+
3124
/**
3225
* @author boris
3326
*/
@@ -131,4 +124,17 @@ public WxMaShopBaseResponse delistingSpu(Integer productId, String outProductId)
131124
}
132125
return WxMaGsonBuilder.create().fromJson(responseContent, WxMaShopBaseResponse.class);
133126
}
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+
}
134140
}

weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ interface Spu {
311311
String SPU_UPDATE_WITHOUT_URL = "https://api.weixin.qq.com/shop/spu/update_without_audit";
312312
String SPU_LISTING_URL = "https://api.weixin.qq.com/shop/spu/listing";
313313
String SPU_DELISTING_URL = "https://api.weixin.qq.com/shop/spu/delisting";
314+
String DEL_AUDIT_URL = "https://api.weixin.qq.com/shop/spu/del_audit";
314315
}
315316

316317
interface Order {

0 commit comments

Comments
 (0)