🆕 #2255 【小程序】增加自定义组件之接入商品前必需的接口
This commit is contained in:
@@ -433,6 +433,13 @@ public interface WxMaService extends WxService {
|
|||||||
*/
|
*/
|
||||||
WxMaShopImgService getShopImgService();
|
WxMaShopImgService getShopImgService();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序交易组件-接入商品前必需接口-审核相关接口
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
WxMaShopAuditService getShopAuditService();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取小程序 URL Link服务接口
|
* 获取小程序 URL Link服务接口
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package cn.binarywang.wx.miniapp.api;
|
||||||
|
|
||||||
|
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAuditBrandRequest;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAuditCategoryRequest;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAuditBrandResponse;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAuditCategoryResponse;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAuditResultResponse;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import me.chanjar.weixin.common.error.WxErrorException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序交易组件-接入商品前必需接口(审核相关接口)
|
||||||
|
*
|
||||||
|
* @author liming1019
|
||||||
|
* @date 2021/8/12
|
||||||
|
*/
|
||||||
|
public interface WxMaShopAuditService {
|
||||||
|
/**
|
||||||
|
* 上传品牌信息(品牌审核)
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @return WxMaShopAuditBrandResponse
|
||||||
|
* @throws WxErrorException
|
||||||
|
*/
|
||||||
|
WxMaShopAuditBrandResponse auditBrand(WxMaShopAuditBrandRequest request) throws WxErrorException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传类目资质(类目审核)
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
* @throws WxErrorException
|
||||||
|
*/
|
||||||
|
WxMaShopAuditCategoryResponse auditCategory(WxMaShopAuditCategoryRequest request) throws WxErrorException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取审核结果
|
||||||
|
*
|
||||||
|
* @param auditId
|
||||||
|
* @return WxMaShopAuditResultResponse
|
||||||
|
* @throws WxErrorException
|
||||||
|
*/
|
||||||
|
WxMaShopAuditResultResponse getAuditResult(String auditId) throws WxErrorException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取小程序提交过的入驻资质信息
|
||||||
|
*
|
||||||
|
* @param reqType
|
||||||
|
* @return JsonObject
|
||||||
|
* @throws WxErrorException
|
||||||
|
*/
|
||||||
|
JsonObject getMiniappCertificate(int reqType) throws WxErrorException;
|
||||||
|
}
|
||||||
@@ -69,6 +69,7 @@ public abstract class BaseWxMaServiceImpl<H, P> implements WxMaService, RequestH
|
|||||||
private final WxMaShopAccountService shopAccountService = new WxMaShopAccountServiceImpl(this);
|
private final WxMaShopAccountService shopAccountService = new WxMaShopAccountServiceImpl(this);
|
||||||
private final WxMaShopCatService shopCatService = new WxMaShopCatServiceImpl(this);
|
private final WxMaShopCatService shopCatService = new WxMaShopCatServiceImpl(this);
|
||||||
private final WxMaShopImgService shopImgService = new WxMaShopImgServiceImpl(this);
|
private final WxMaShopImgService shopImgService = new WxMaShopImgServiceImpl(this);
|
||||||
|
private final WxMaShopAuditService shopAuditService = new WxMaShopAuditServiceImpl(this);
|
||||||
private final WxMaLinkService linkService = new WxMaLinkServiceImpl(this);
|
private final WxMaLinkService linkService = new WxMaLinkServiceImpl(this);
|
||||||
private final WxMaReimburseInvoiceService reimburseInvoiceService = new WxMaReimburseInvoiceServiceImpl(this);
|
private final WxMaReimburseInvoiceService reimburseInvoiceService = new WxMaReimburseInvoiceServiceImpl(this);
|
||||||
private Map<String, WxMaConfig> configMap;
|
private Map<String, WxMaConfig> configMap;
|
||||||
@@ -540,6 +541,11 @@ public abstract class BaseWxMaServiceImpl<H, P> implements WxMaService, RequestH
|
|||||||
return this.shopImgService;
|
return this.shopImgService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WxMaShopAuditService getShopAuditService() {
|
||||||
|
return this.shopAuditService;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WxMaLinkService getLinkService() {
|
public WxMaLinkService getLinkService() {
|
||||||
return this.linkService;
|
return this.linkService;
|
||||||
|
|||||||
@@ -0,0 +1,101 @@
|
|||||||
|
package cn.binarywang.wx.miniapp.api.impl;
|
||||||
|
|
||||||
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
||||||
|
import cn.binarywang.wx.miniapp.api.WxMaShopAuditService;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAuditBrandRequest;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAuditCategoryRequest;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAuditBrandResponse;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAuditCategoryResponse;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAuditResultResponse;
|
||||||
|
import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import me.chanjar.weixin.common.enums.WxType;
|
||||||
|
import me.chanjar.weixin.common.error.WxError;
|
||||||
|
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.Audit.*;
|
||||||
|
import static cn.binarywang.wx.miniapp.constant.WxMaConstants.ERRCODE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序交易组件-接入商品前必需接口(审核相关接口)
|
||||||
|
*
|
||||||
|
* @author liming1019
|
||||||
|
* @date 2021/8/12
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class WxMaShopAuditServiceImpl implements WxMaShopAuditService {
|
||||||
|
private final WxMaService wxMaService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传品牌信息(品牌审核)
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @return WxMaShopAuditBrandResponse
|
||||||
|
* @throws WxErrorException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WxMaShopAuditBrandResponse auditBrand(WxMaShopAuditBrandRequest request) throws WxErrorException {
|
||||||
|
String responseContent = this.wxMaService.post(AUDIT_BRAND, request);
|
||||||
|
JsonObject jsonObject = GsonParser.parse(responseContent);
|
||||||
|
if (jsonObject.get(ERRCODE).getAsInt() != 0) {
|
||||||
|
throw new WxErrorException(WxError.fromJson(responseContent, WxType.MiniApp));
|
||||||
|
}
|
||||||
|
return WxMaGsonBuilder.create().fromJson(responseContent, WxMaShopAuditBrandResponse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传类目资质(类目审核)
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
* @throws WxErrorException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WxMaShopAuditCategoryResponse auditCategory(WxMaShopAuditCategoryRequest request) throws WxErrorException {
|
||||||
|
String responseContent = this.wxMaService.post(AUDIT_CATEGORY, request);
|
||||||
|
JsonObject jsonObject = GsonParser.parse(responseContent);
|
||||||
|
if (jsonObject.get(ERRCODE).getAsInt() != 0) {
|
||||||
|
throw new WxErrorException(WxError.fromJson(responseContent, WxType.MiniApp));
|
||||||
|
}
|
||||||
|
return WxMaGsonBuilder.create().fromJson(responseContent, WxMaShopAuditCategoryResponse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取审核结果
|
||||||
|
*
|
||||||
|
* @param auditId
|
||||||
|
* @return WxMaShopAuditResultResponse
|
||||||
|
* @throws WxErrorException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WxMaShopAuditResultResponse getAuditResult(String auditId) throws WxErrorException {
|
||||||
|
String responseContent = this.wxMaService.post(AUDIT_RESULT, GsonHelper.buildJsonObject("audit_id", auditId));
|
||||||
|
JsonObject jsonObject = GsonParser.parse(responseContent);
|
||||||
|
if (jsonObject.get(ERRCODE).getAsInt() != 0) {
|
||||||
|
throw new WxErrorException(WxError.fromJson(responseContent, WxType.MiniApp));
|
||||||
|
}
|
||||||
|
return WxMaGsonBuilder.create().fromJson(responseContent, WxMaShopAuditResultResponse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取小程序提交过的入驻资质信息
|
||||||
|
*
|
||||||
|
* @param reqType
|
||||||
|
* @return JsonObject
|
||||||
|
* @throws WxErrorException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public JsonObject getMiniappCertificate(int reqType) throws WxErrorException {
|
||||||
|
String responseContent = this.wxMaService.post(GET_MINIAPP_CERTIFICATE, GsonHelper.buildJsonObject("req_type", reqType));
|
||||||
|
JsonObject jsonObject = GsonParser.parse(responseContent);
|
||||||
|
if (jsonObject.get(ERRCODE).getAsInt() != 0) {
|
||||||
|
throw new WxErrorException(WxError.fromJson(responseContent, WxType.MiniApp));
|
||||||
|
}
|
||||||
|
return WxMaGsonBuilder.create().fromJson(responseContent, JsonObject.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
package cn.binarywang.wx.miniapp.bean.shop.request;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liming1019
|
||||||
|
* @date 2021/8/12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public class WxMaShopAuditBrandRequest implements Serializable {
|
||||||
|
private static final long serialVersionUID = -969331692973992066L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* audit_req : {"license":["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"],"brand_info":{"brand_audit_type":1,"trademark_type":"29","brand_management_type":2,"commodity_origin_type":2,"brand_wording":"346225226351203275","sale_authorization":["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"],"trademark_registration_certificate":["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"],"trademark_change_certificate":["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"],"trademark_registrant":"https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg","trademark_registrant_nu":"1249305","trademark_authorization_period":"2020-03-25 12:05:25","trademark_registration_application":["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"],"trademark_applicant":"张三","trademark_application_time":"2020-03-25 12:05:25","imported_goods_form":["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"]}}
|
||||||
|
*/
|
||||||
|
|
||||||
|
@SerializedName("audit_req")
|
||||||
|
private AuditReqBean auditReq;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public static class AuditReqBean implements Serializable {
|
||||||
|
/**
|
||||||
|
* license : ["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"]
|
||||||
|
* brand_info : {"brand_audit_type":1,"trademark_type":"29","brand_management_type":2,"commodity_origin_type":2,"brand_wording":"346225226351203275","sale_authorization":["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"],"trademark_registration_certificate":["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"],"trademark_change_certificate":["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"],"trademark_registrant":"https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg","trademark_registrant_nu":"1249305","trademark_authorization_period":"2020-03-25 12:05:25","trademark_registration_application":["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"],"trademark_applicant":"张三","trademark_application_time":"2020-03-25 12:05:25","imported_goods_form":["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"]}
|
||||||
|
*/
|
||||||
|
|
||||||
|
@SerializedName("brand_info")
|
||||||
|
private BrandInfoBean brandInfo;
|
||||||
|
@SerializedName("license")
|
||||||
|
private List<String> license;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public static class BrandInfoBean implements Serializable {
|
||||||
|
/**
|
||||||
|
* brand_audit_type : 1
|
||||||
|
* trademark_type : 29
|
||||||
|
* brand_management_type : 2
|
||||||
|
* commodity_origin_type : 2
|
||||||
|
* brand_wording : 346225226351203275
|
||||||
|
* sale_authorization : ["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"]
|
||||||
|
* trademark_registration_certificate : ["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"]
|
||||||
|
* trademark_change_certificate : ["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"]
|
||||||
|
* trademark_registrant : https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg
|
||||||
|
* trademark_registrant_nu : 1249305
|
||||||
|
* trademark_authorization_period : 2020-03-25 12:05:25
|
||||||
|
* trademark_registration_application : ["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"]
|
||||||
|
* trademark_applicant : 张三
|
||||||
|
* trademark_application_time : 2020-03-25 12:05:25
|
||||||
|
* imported_goods_form : ["https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg"]
|
||||||
|
*/
|
||||||
|
|
||||||
|
@SerializedName("brand_audit_type")
|
||||||
|
private Integer brandAuditType;
|
||||||
|
@SerializedName("trademark_type")
|
||||||
|
private String trademarkType;
|
||||||
|
@SerializedName("brand_management_type")
|
||||||
|
private Integer brandManagementType;
|
||||||
|
@SerializedName("commodity_origin_type")
|
||||||
|
private Integer commodityOriginType;
|
||||||
|
@SerializedName("brand_wording")
|
||||||
|
private String brandWording;
|
||||||
|
@SerializedName("trademark_registrant")
|
||||||
|
private String trademarkRegistrant;
|
||||||
|
@SerializedName("trademark_registrant_nu")
|
||||||
|
private String trademarkRegistrantNu;
|
||||||
|
@SerializedName("trademark_authorization_period")
|
||||||
|
private String trademarkAuthorizationPeriod;
|
||||||
|
@SerializedName("trademark_applicant")
|
||||||
|
private String trademarkApplicant;
|
||||||
|
@SerializedName("trademark_application_time")
|
||||||
|
private String trademarkApplicationTime;
|
||||||
|
@SerializedName("sale_authorization")
|
||||||
|
private List<String> saleAuthorization;
|
||||||
|
@SerializedName("trademark_registration_certificate")
|
||||||
|
private List<String> trademarkRegistrationCertificate;
|
||||||
|
@SerializedName("trademark_change_certificate")
|
||||||
|
private List<String> trademarkChangeCertificate;
|
||||||
|
@SerializedName("trademark_registration_application")
|
||||||
|
private List<String> trademarkRegistrationApplication;
|
||||||
|
@SerializedName("imported_goods_form")
|
||||||
|
private List<String> importedGoodsForm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package cn.binarywang.wx.miniapp.bean.shop.request;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liming1019
|
||||||
|
* @date 2021/8/12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public class WxMaShopAuditCategoryRequest implements Serializable {
|
||||||
|
private static final long serialVersionUID = -6730876344556487071L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* audit_req : {"license":["www.xxxxx.com"],"category_info":{"level1":7419,"level2":7439,"level3":7448,"certificate":["www.xxx.com"]}}
|
||||||
|
*/
|
||||||
|
|
||||||
|
@SerializedName("audit_req")
|
||||||
|
private AuditReqBean auditReq;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public static class AuditReqBean implements Serializable {
|
||||||
|
/**
|
||||||
|
* license : ["www.xxxxx.com"]
|
||||||
|
* category_info : {"level1":7419,"level2":7439,"level3":7448,"certificate":["www.xxx.com"]}
|
||||||
|
*/
|
||||||
|
|
||||||
|
@SerializedName("category_info")
|
||||||
|
private CategoryInfoBean categoryInfo;
|
||||||
|
@SerializedName("license")
|
||||||
|
private List<String> license;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public static class CategoryInfoBean implements Serializable {
|
||||||
|
/**
|
||||||
|
* level1 : 7419
|
||||||
|
* level2 : 7439
|
||||||
|
* level3 : 7448
|
||||||
|
* certificate : ["www.xxx.com"]
|
||||||
|
*/
|
||||||
|
|
||||||
|
@SerializedName("level1")
|
||||||
|
private Integer level1;
|
||||||
|
@SerializedName("level2")
|
||||||
|
private Integer level2;
|
||||||
|
@SerializedName("level3")
|
||||||
|
private Integer level3;
|
||||||
|
@SerializedName("certificate")
|
||||||
|
private List<String> certificate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package cn.binarywang.wx.miniapp.bean.shop.response;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liming1019
|
||||||
|
* @date 2021/8/12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class WxMaShopAuditBrandResponse extends WxMaShopBaseResponse implements Serializable {
|
||||||
|
private static final long serialVersionUID = -4643316662725276237L;
|
||||||
|
|
||||||
|
@SerializedName("audit_id")
|
||||||
|
private String auditId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package cn.binarywang.wx.miniapp.bean.shop.response;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liming1019
|
||||||
|
* @date 2021/8/12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class WxMaShopAuditCategoryResponse extends WxMaShopBaseResponse implements Serializable {
|
||||||
|
private static final long serialVersionUID = -1822188134865177738L;
|
||||||
|
|
||||||
|
@SerializedName("audit_id")
|
||||||
|
private String auditId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package cn.binarywang.wx.miniapp.bean.shop.response;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liming1019
|
||||||
|
* @date 2021/8/12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class WxMaShopAuditResultResponse extends WxMaShopBaseResponse implements Serializable {
|
||||||
|
private static final long serialVersionUID = -1068201722686667490L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* data : {"status":9,"brand_id":0,"reject_reason":"请重新提交审核"}
|
||||||
|
*/
|
||||||
|
|
||||||
|
@SerializedName("data")
|
||||||
|
private DataBean data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class DataBean implements Serializable {
|
||||||
|
/**
|
||||||
|
* status : 9
|
||||||
|
* brand_id : 0
|
||||||
|
* reject_reason : 请重新提交审核
|
||||||
|
*/
|
||||||
|
|
||||||
|
@SerializedName("status")
|
||||||
|
private Integer status;
|
||||||
|
@SerializedName("brand_id")
|
||||||
|
private Integer brandId;
|
||||||
|
@SerializedName("reject_reason")
|
||||||
|
private String rejectReason;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -341,6 +341,13 @@ public class WxMaApiUrlConstants {
|
|||||||
interface Img {
|
interface Img {
|
||||||
String IMG_UPLOAD = "https://api.weixin.qq.com/shop/img/upload";
|
String IMG_UPLOAD = "https://api.weixin.qq.com/shop/img/upload";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface Audit {
|
||||||
|
String AUDIT_BRAND = "https://api.weixin.qq.com/shop/audit/audit_brand";
|
||||||
|
String AUDIT_CATEGORY = "https://api.weixin.qq.com/shop/audit/audit_category";
|
||||||
|
String AUDIT_RESULT = "https://api.weixin.qq.com/shop/audit/result";
|
||||||
|
String GET_MINIAPP_CERTIFICATE = "https://api.weixin.qq.com/shop/audit/get_miniapp_certificate";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
package cn.binarywang.wx.miniapp.api.impl;
|
||||||
|
|
||||||
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAuditBrandRequest;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAuditCategoryRequest;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAuditBrandResponse;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAuditCategoryResponse;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAuditResultResponse;
|
||||||
|
import cn.binarywang.wx.miniapp.test.ApiTestModule;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import me.chanjar.weixin.common.error.WxErrorException;
|
||||||
|
import org.testng.annotations.Guice;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liming1019
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Guice(modules = ApiTestModule.class)
|
||||||
|
public class WxMaShopAuditServiceImplTest {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private WxMaService wxService;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAuditBrand() throws WxErrorException {
|
||||||
|
WxMaShopAuditBrandRequest request = WxMaShopAuditBrandRequest.builder().build();
|
||||||
|
WxMaShopAuditBrandRequest.AuditReqBean auditReqBean = WxMaShopAuditBrandRequest.AuditReqBean.builder().build();
|
||||||
|
|
||||||
|
auditReqBean.setLicense(new ArrayList<String>(Arrays.asList("https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg")));
|
||||||
|
auditReqBean.setBrandInfo(WxMaShopAuditBrandRequest.AuditReqBean.BrandInfoBean.builder()
|
||||||
|
.brandAuditType(1)
|
||||||
|
.trademarkType("29")
|
||||||
|
.brandManagementType(2)
|
||||||
|
.commodityOriginType(2)
|
||||||
|
.brandWording("346225226351203275")
|
||||||
|
.saleAuthorization(new ArrayList<String>(Arrays.asList("https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg")))
|
||||||
|
.trademarkRegistrationCertificate(new ArrayList<String>(Arrays.asList("https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg")))
|
||||||
|
.trademarkChangeCertificate(new ArrayList<String>(Arrays.asList("https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg")))
|
||||||
|
.trademarkRegistrant("https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg")
|
||||||
|
.trademarkRegistrantNu("1249305")
|
||||||
|
.trademarkAuthorizationPeriod("2020-03-25 12:05:25")
|
||||||
|
.trademarkRegistrationApplication(new ArrayList<String>(Arrays.asList("https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg")))
|
||||||
|
.trademarkApplicant("张三")
|
||||||
|
.trademarkApplicationTime("2020-03-25 12:05:25")
|
||||||
|
.importedGoodsForm(new ArrayList<String>(Arrays.asList("https://img.zhls.qq.com/3/609b98f7e0ff43d59ce6d9cca636c3e0.jpg")))
|
||||||
|
.build());
|
||||||
|
request.setAuditReq(auditReqBean);
|
||||||
|
|
||||||
|
WxMaShopAuditBrandResponse response = wxService.getShopAuditService().auditBrand(request);
|
||||||
|
assertThat(response).isNotNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAuditCategory() throws WxErrorException {
|
||||||
|
WxMaShopAuditCategoryRequest request = WxMaShopAuditCategoryRequest.builder().build();
|
||||||
|
WxMaShopAuditCategoryRequest.AuditReqBean auditReqBean = WxMaShopAuditCategoryRequest.AuditReqBean.builder().build();
|
||||||
|
auditReqBean.setLicense(new ArrayList<String>(Arrays.asList("www.xxxxx.com")));
|
||||||
|
auditReqBean.setCategoryInfo(WxMaShopAuditCategoryRequest.AuditReqBean.CategoryInfoBean.builder()
|
||||||
|
.level1(7419)
|
||||||
|
.level2(7439)
|
||||||
|
.level3(7448)
|
||||||
|
.certificate(new ArrayList<String>(Arrays.asList("www.xxxxx.com")))
|
||||||
|
.build());
|
||||||
|
request.setAuditReq(auditReqBean);
|
||||||
|
WxMaShopAuditCategoryResponse response = wxService.getShopAuditService().auditCategory(request);
|
||||||
|
assertThat(response).isNotNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetAuditResult() throws WxErrorException {
|
||||||
|
WxMaShopAuditResultResponse response = wxService.getShopAuditService().getAuditResult("RQAAAHIOW-QGAAAAveAUYQ");
|
||||||
|
assertThat(response).isNotNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetMiniappCertificate1() throws WxErrorException {
|
||||||
|
JsonObject response = wxService.getShopAuditService().getMiniappCertificate(1);
|
||||||
|
assertThat(response).isNotNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetMiniappCertificate2() throws WxErrorException {
|
||||||
|
JsonObject response = wxService.getShopAuditService().getMiniappCertificate(2);
|
||||||
|
assertThat(response).isNotNull();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user