Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
*/
Expand Down Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down