1
0
mirror of synced 2025-12-15 19:47:58 +08:00

🆕 #2260【小程序】增加自定义组件之撤销商品审核的接口

This commit is contained in:
ShienPro
2021-08-19 10:56:34 +08:00
committed by GitHub
parent 614a1c923e
commit 28b2ca93fb
3 changed files with 19 additions and 9 deletions

View File

@@ -35,4 +35,7 @@ public interface WxMaShopSpuService {
WxMaShopBaseResponse delistingSpu(Integer productId, String outProductId)
throws WxErrorException;
WxMaShopBaseResponse deleteAudit(Integer productId, String outProductId)
throws WxErrorException;
}

View File

@@ -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.error.WxErrorException;
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 class WxMaShopSpuServiceImpl implements WxMaShopSpuService {
}
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);
}
}

View File

@@ -311,6 +311,7 @@ public class WxMaApiUrlConstants {
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 {