Selaa lähdekoodia

:new: #2249 【小程序】增加自定义组件之商家入驻相关接口

liming1019 3 vuotta sitten
vanhempi
commit
16d98a6142
18 muutettua tiedostoa jossa 582 lisäystä ja 0 poistoa
  1. 19 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java
  2. 48 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaShopAccountService.java
  3. 19 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaShopCatService.java
  4. 12 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java
  5. 69 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaShopAccountServiceImpl.java
  6. 35 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaShopCatServiceImpl.java
  7. 28 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/WxMaShopAccountGetBrandListItem.java
  8. 48 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/WxMaShopAccountGetCategoryListItem.java
  9. 26 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/WxMaShopAccountGetInfo.java
  10. 75 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/WxMaShopCatGetDetail.java
  11. 26 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/request/WxMaShopAccountUpdateInfoRequest.java
  12. 22 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaShopAccountGetBrandListResponse.java
  13. 22 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaShopAccountGetCategoryListResponse.java
  14. 21 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaShopAccountGetInfoResponse.java
  15. 22 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaShopCatGetResponse.java
  16. 11 0
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java
  17. 51 0
      weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaShopAccountServiceImplTest.java
  18. 28 0
      weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaShopCatServiceImplTest.java

+ 19 - 0
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java

@@ -393,30 +393,49 @@ public interface WxMaService extends WxService {
 
   /**
    * 返回小程序交易组件-订单服务接口
+   *
    * @return
    */
   WxMaShopOrderService getShopOrderService();
 
   /**
    * 返回小程序交易组件-spu商品服务接口
+   *
    * @return
    */
   WxMaShopSpuService getShopSpuService();
 
   /**
    * 返回小程序交易组件-接入申请接口
+   *
    * @return
    */
   WxMaShopRegisterService getShopRegisterService();
 
   /**
+   * 返回小程序交易组件-商户入驻接口
+   *
+   * @return
+   */
+  WxMaShopAccountService getShopAccountService();
+
+  /**
+   * 小程序交易组件-接入商品前必需接口-类目相关
+   *
+   * @return
+   */
+  WxMaShopCatService getShopCatService();
+
+  /**
    * 获取小程序 URL Link服务接口
+   *
    * @return
    */
   WxMaLinkService getLinkService();
 
   /**
    * 获取电子发票报销方服务接口
+   *
    * @return
    */
   WxMaReimburseInvoiceService getReimburseInvoiceService();

+ 48 - 0
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaShopAccountService.java

@@ -0,0 +1,48 @@
+package cn.binarywang.wx.miniapp.api;
+
+import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAccountUpdateInfoRequest;
+import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAccountGetBrandListResponse;
+import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAccountGetCategoryListResponse;
+import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAccountGetInfoResponse;
+import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopBaseResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 小程序交易组件-商家入驻接口
+ *
+ * @author liming1019
+ */
+public interface WxMaShopAccountService {
+  /**
+   * 获取商家类目列表
+   *
+   * @return WxMaShopAccountGetCategoryListResponse
+   * @throws WxErrorException
+   */
+  WxMaShopAccountGetCategoryListResponse getCategoryList() throws WxErrorException;
+
+  /**
+   * 获取商家品牌列表
+   *
+   * @return WxMaShopAccountGetBrandListResponse
+   * @throws WxErrorException
+   */
+  WxMaShopAccountGetBrandListResponse getBrandList() throws WxErrorException;
+
+  /**
+   * 更新商家信息
+   *
+   * @param request
+   * @return WxMaShopBaseResponse
+   * @throws WxErrorException
+   */
+  WxMaShopBaseResponse updateInfo(WxMaShopAccountUpdateInfoRequest request) throws WxErrorException;
+
+  /**
+   * 获取商家信息
+   *
+   * @return WxMaShopAccountGetInfoResponse
+   * @throws WxErrorException
+   */
+  WxMaShopAccountGetInfoResponse getInfo() throws WxErrorException;
+}

+ 19 - 0
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaShopCatService.java

@@ -0,0 +1,19 @@
+package cn.binarywang.wx.miniapp.api;
+
+import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopCatGetResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 小程序交易组件-接入商品前必需接口
+ *
+ * @author liming1019
+ */
+public interface WxMaShopCatService {
+  /**
+   * 获取商品类目
+   *
+   * @return WxMaShopCatGetResponse
+   * @throws WxErrorException
+   */
+  WxMaShopCatGetResponse getCat() throws WxErrorException;
+}

+ 12 - 0
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java

@@ -66,6 +66,8 @@ public abstract class BaseWxMaServiceImpl<H, P> implements WxMaService, RequestH
   private final WxMaShopSpuService shopSpuService = new WxMaShopSpuServiceImpl(this);
   private final WxMaShopOrderService shopOrderService = new WxMaShopOrderServiceImpl(this);
   private final WxMaShopRegisterService shopRegisterService = new WxMaShopRegisterServiceImpl(this);
+  private final WxMaShopAccountService shopAccountService = new WxMaShopAccountServiceImpl(this);
+  private final WxMaShopCatService shopCatService = new WxMaShopCatServiceImpl(this);
   private final WxMaLinkService linkService = new WxMaLinkServiceImpl(this);
   private final WxMaReimburseInvoiceService reimburseInvoiceService = new WxMaReimburseInvoiceServiceImpl(this);
   private Map<String, WxMaConfig> configMap;
@@ -523,6 +525,16 @@ public abstract class BaseWxMaServiceImpl<H, P> implements WxMaService, RequestH
   }
 
   @Override
+  public WxMaShopAccountService getShopAccountService() {
+    return this.shopAccountService;
+  }
+
+  @Override
+  public WxMaShopCatService getShopCatService() {
+    return this.shopCatService;
+  }
+
+  @Override
   public WxMaLinkService getLinkService() {
     return this.linkService;
   }

+ 69 - 0
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaShopAccountServiceImpl.java

@@ -0,0 +1,69 @@
+package cn.binarywang.wx.miniapp.api.impl;
+
+import cn.binarywang.wx.miniapp.api.WxMaService;
+import cn.binarywang.wx.miniapp.api.WxMaShopAccountService;
+import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAccountUpdateInfoRequest;
+import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAccountGetBrandListResponse;
+import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAccountGetCategoryListResponse;
+import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAccountGetInfoResponse;
+import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopBaseResponse;
+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.GsonParser;
+
+import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Account.*;
+
+/**
+ * @author liming1019
+ */
+@RequiredArgsConstructor
+@Slf4j
+public class WxMaShopAccountServiceImpl implements WxMaShopAccountService {
+  private static final String ERR_CODE = "errcode";
+  private final WxMaService wxMaService;
+
+  @Override
+  public WxMaShopAccountGetCategoryListResponse getCategoryList() throws WxErrorException {
+    String responseContent = this.wxMaService.post(GET_CATEGORY_LIST, new JsonObject());
+    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, WxMaShopAccountGetCategoryListResponse.class);
+  }
+
+  @Override
+  public WxMaShopAccountGetBrandListResponse getBrandList() throws WxErrorException {
+    String responseContent = this.wxMaService.post(GET_BRAND_LIST, new JsonObject());
+    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, WxMaShopAccountGetBrandListResponse.class);
+  }
+
+  @Override
+  public WxMaShopBaseResponse updateInfo(WxMaShopAccountUpdateInfoRequest request) throws WxErrorException {
+    String responseContent = this.wxMaService.post(UPDATE_INFO, request);
+    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);
+  }
+
+  @Override
+  public WxMaShopAccountGetInfoResponse getInfo() throws WxErrorException {
+    String responseContent = this.wxMaService.post(GET_INFO, new JsonObject());
+    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, WxMaShopAccountGetInfoResponse.class);
+  }
+}

+ 35 - 0
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaShopCatServiceImpl.java

@@ -0,0 +1,35 @@
+package cn.binarywang.wx.miniapp.api.impl;
+
+import cn.binarywang.wx.miniapp.api.WxMaService;
+import cn.binarywang.wx.miniapp.api.WxMaShopCatService;
+import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopCatGetResponse;
+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.GsonParser;
+
+import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Cat.GET_CAT;
+import static cn.binarywang.wx.miniapp.constant.WxMaConstants.ERRCODE;
+
+/**
+ * @author liming1019
+ */
+@RequiredArgsConstructor
+@Slf4j
+public class WxMaShopCatServiceImpl implements WxMaShopCatService {
+  private final WxMaService wxMaService;
+
+  @Override
+  public WxMaShopCatGetResponse getCat() throws WxErrorException {
+    String responseContent = this.wxMaService.post(GET_CAT, new JsonObject());
+    JsonObject jsonObject = GsonParser.parse(responseContent);
+    if (jsonObject.get(ERRCODE).getAsInt() != 0) {
+      throw new WxErrorException(WxError.fromJson(responseContent, WxType.MiniApp));
+    }
+    return WxMaGsonBuilder.create().fromJson(responseContent, WxMaShopCatGetResponse.class);
+  }
+}

+ 28 - 0
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/WxMaShopAccountGetBrandListItem.java

@@ -0,0 +1,28 @@
+package cn.binarywang.wx.miniapp.bean.shop;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author liming1019
+ * @date 2021/8/9
+ */
+@Data
+public class WxMaShopAccountGetBrandListItem implements Serializable {
+  private static final long serialVersionUID = -8889271375365538573L;
+
+  /**
+   * 品牌ID
+   */
+  @SerializedName("brand_id")
+  private Long brandId;
+
+  /**
+   * 品牌名称
+   */
+  @SerializedName("brand_wording")
+  private String brandWording;
+}
+

+ 48 - 0
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/WxMaShopAccountGetCategoryListItem.java

@@ -0,0 +1,48 @@
+package cn.binarywang.wx.miniapp.bean.shop;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author liming1019
+ * @date 2021/8/9
+ */
+@Data
+public class WxMaShopAccountGetCategoryListItem implements Serializable {
+  private static final long serialVersionUID = -6574489801942310752L;
+
+  /**
+   * 一级类目ID
+   */
+  @SerializedName("first_cat_id")
+  private Long firstCatId;
+  /**
+   * 二级类目ID
+   */
+  @SerializedName("second_cat_id")
+  private Long secondCatId;
+  /**
+   * 类目ID
+   */
+  @SerializedName("third_cat_id")
+  private Long thirdCatId;
+  /**
+   * 一级类目名称
+   */
+  @SerializedName("first_cat_name")
+  private String firstCatName;
+  /**
+   * 二级类目名称
+   */
+  @SerializedName("second_cat_name")
+  private String secondCatName;
+
+  /**
+   * 类目名称
+   */
+  @SerializedName("third_cat_name")
+  private String thirdCatName;
+}
+

+ 26 - 0
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/WxMaShopAccountGetInfo.java

@@ -0,0 +1,26 @@
+package cn.binarywang.wx.miniapp.bean.shop;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author liming1019
+ * @date 2021/8/9
+ */
+@Data
+public class WxMaShopAccountGetInfo implements Serializable {
+  /**
+   * 品牌ID
+   */
+  @SerializedName("brand_id")
+  private Long brandId;
+
+  /**
+   * 品牌名称
+   */
+  @SerializedName("brand_wording")
+  private String brandWording;
+}
+

+ 75 - 0
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/WxMaShopCatGetDetail.java

@@ -0,0 +1,75 @@
+package cn.binarywang.wx.miniapp.bean.shop;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author liming1019
+ * @date 2021/8/9
+ */
+@Data
+public class WxMaShopCatGetDetail implements Serializable {
+  private static final long serialVersionUID = -3404372682043466685L;
+
+  /**
+   * 类目ID
+   */
+  @SerializedName("third_cat_id")
+  private Long thirdCatId;
+
+  /**
+   * 类目名称
+   */
+  @SerializedName("third_cat_name")
+  private String thirdCatName;
+
+  /**
+   * 类目资质
+   */
+  @SerializedName("qualification")
+  private String qualification;
+
+  /**
+   * 类目资质类型,0:不需要,1:必填,2:选填
+   */
+  @SerializedName("qualification_type")
+  private Integer qualificationType;
+
+  /**
+   * 商品资质
+   */
+  @SerializedName("product_qualification")
+  private String productQualification;
+
+  /**
+   * 商品资质类型,0:不需要,1:必填,2:选填
+   */
+  @SerializedName("product_qualification_type")
+  private Integer productQualificationType;
+
+  /**
+   * 一级类目ID
+   */
+  @SerializedName("first_cat_id")
+  private Long firstCatId;
+
+  /**
+   * 一级类目名称
+   */
+  @SerializedName("first_cat_name")
+  private String firstCatName;
+
+  /**
+   * 二级类目ID
+   */
+  @SerializedName("second_cat_id")
+  private Long secondCatId;
+
+  /**
+   * 二级类目名称
+   */
+  @SerializedName("second_cat_name")
+  private String secondCatName;
+}

+ 26 - 0
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/request/WxMaShopAccountUpdateInfoRequest.java

@@ -0,0 +1,26 @@
+package cn.binarywang.wx.miniapp.bean.shop.request;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author liming1019
+ * @date 2021/8/9
+ */
+@Data
+public class WxMaShopAccountUpdateInfoRequest implements Serializable {
+  private static final long serialVersionUID = 5185978220275730559L;
+  /**
+   * 小程序path
+   */
+  @SerializedName("service_agent_path")
+  private String serviceAgentPath;
+
+  /**
+   * 小程序path
+   */
+  @SerializedName("service_agent_phone")
+  private String serviceAgentPhone;
+}

+ 22 - 0
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaShopAccountGetBrandListResponse.java

@@ -0,0 +1,22 @@
+package cn.binarywang.wx.miniapp.bean.shop.response;
+
+import cn.binarywang.wx.miniapp.bean.shop.WxMaShopAccountGetBrandListItem;
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author liming1019
+ * @date 2021/8/9
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class WxMaShopAccountGetBrandListResponse extends WxMaShopBaseResponse implements Serializable {
+  private static final long serialVersionUID = -5196210913054514206L;
+
+  @SerializedName("data")
+  private List<WxMaShopAccountGetBrandListItem> items;
+}

+ 22 - 0
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaShopAccountGetCategoryListResponse.java

@@ -0,0 +1,22 @@
+package cn.binarywang.wx.miniapp.bean.shop.response;
+
+import cn.binarywang.wx.miniapp.bean.shop.WxMaShopAccountGetCategoryListItem;
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author liming1019
+ * @date 2021/8/9
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class WxMaShopAccountGetCategoryListResponse extends WxMaShopBaseResponse implements Serializable {
+  private static final long serialVersionUID = -3182300077261435356L;
+
+  @SerializedName("data")
+  private List<WxMaShopAccountGetCategoryListItem> items;
+}

+ 21 - 0
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaShopAccountGetInfoResponse.java

@@ -0,0 +1,21 @@
+package cn.binarywang.wx.miniapp.bean.shop.response;
+
+import cn.binarywang.wx.miniapp.bean.shop.WxMaShopAccountGetInfo;
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+/**
+ * @author liming1019
+ * @date 2021/8/9
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class WxMaShopAccountGetInfoResponse extends WxMaShopBaseResponse implements Serializable {
+  private static final long serialVersionUID = -3954383181691898592L;
+
+  @SerializedName("data")
+  private WxMaShopAccountGetInfo data;
+}

+ 22 - 0
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaShopCatGetResponse.java

@@ -0,0 +1,22 @@
+package cn.binarywang.wx.miniapp.bean.shop.response;
+
+import cn.binarywang.wx.miniapp.bean.shop.WxMaShopCatGetDetail;
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author liming1019
+ * @date 2021/8/9
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class WxMaShopCatGetResponse extends WxMaShopBaseResponse implements Serializable {
+  private static final long serialVersionUID = -2565959470798387313L;
+
+  @SerializedName("third_cat_list")
+  private List<WxMaShopCatGetDetail> thirdCatList;
+}

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

@@ -326,6 +326,17 @@ public class WxMaApiUrlConstants {
       String REGISTER_FINISH_ACCESS_INFO = "https://api.weixin.qq.com/shop/register/finish_access_info";
       String REGISTER_APPLY_SCENE = "https://api.weixin.qq.com/shop/register/apply_scene";
     }
+
+    interface Account {
+      String GET_CATEGORY_LIST = "https://api.weixin.qq.com/shop/account/get_category_list";
+      String GET_BRAND_LIST = "https://api.weixin.qq.com/shop/account/get_brand_list";
+      String UPDATE_INFO = "https://api.weixin.qq.com/shop/account/update_info";
+      String GET_INFO = "https://api.weixin.qq.com/shop/account/get_info";
+    }
+
+    interface Cat {
+      String GET_CAT = "https://api.weixin.qq.com/shop/cat/get";
+    }
   }
 
   /**

+ 51 - 0
weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaShopAccountServiceImplTest.java

@@ -0,0 +1,51 @@
+package cn.binarywang.wx.miniapp.api.impl;
+
+import cn.binarywang.wx.miniapp.api.WxMaService;
+import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAccountUpdateInfoRequest;
+import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopRegisterApplySceneRequest;
+import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopRegisterFinishAccessInfoRequest;
+import cn.binarywang.wx.miniapp.bean.shop.response.*;
+import cn.binarywang.wx.miniapp.test.ApiTestModule;
+import com.google.inject.Inject;
+import me.chanjar.weixin.common.error.WxErrorException;
+import org.testng.annotations.Guice;
+import org.testng.annotations.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * @author liming1019
+ */
+@Test
+@Guice(modules = ApiTestModule.class)
+public class WxMaShopAccountServiceImplTest {
+  @Inject
+  private WxMaService wxService;
+
+  @Test
+  public void testGetCategoryList() throws WxErrorException {
+    WxMaShopAccountGetCategoryListResponse response = this.wxService.getShopAccountService().getCategoryList();
+    assertThat(response).isNotNull();
+  }
+
+  @Test
+  public void testGetBrandList() throws WxErrorException {
+    WxMaShopAccountGetBrandListResponse response = this.wxService.getShopAccountService().getBrandList();
+    assertThat(response).isNotNull();
+  }
+
+  @Test
+  public void testUpdateInfo() throws WxErrorException {
+    WxMaShopAccountUpdateInfoRequest request = new WxMaShopAccountUpdateInfoRequest();
+    request.setServiceAgentPhone("020-888888");
+    request.setServiceAgentPath("https://www.web.com");
+    WxMaShopBaseResponse response = this.wxService.getShopAccountService().updateInfo(request);
+    assertThat(response).isNotNull();
+  }
+
+  @Test
+  public void testGetInfo() throws WxErrorException {
+    WxMaShopAccountGetInfoResponse response = this.wxService.getShopAccountService().getInfo();
+    assertThat(response).isNotNull();
+  }
+}

+ 28 - 0
weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaShopCatServiceImplTest.java

@@ -0,0 +1,28 @@
+package cn.binarywang.wx.miniapp.api.impl;
+
+import cn.binarywang.wx.miniapp.api.WxMaService;
+import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopCatGetResponse;
+import cn.binarywang.wx.miniapp.test.ApiTestModule;
+import com.google.inject.Inject;
+import me.chanjar.weixin.common.error.WxErrorException;
+import org.testng.annotations.Guice;
+import org.testng.annotations.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * @author liming1019
+ */
+@Test
+@Guice(modules = ApiTestModule.class)
+public class WxMaShopCatServiceImplTest {
+
+  @Inject
+  private WxMaService wxService;
+
+  @Test
+  public void testGetCat() throws WxErrorException {
+    WxMaShopCatGetResponse response = this.wxService.getShopCatService().getCat();
+    assertThat(response).isNotNull();
+  }
+}