#516 添加WiFi门店管理查询门店Wi-Fi信息的接口

This commit is contained in:
Binary Wang
2019-06-16 23:07:11 +08:00
parent a4f5aa341b
commit 9c149bb1e2
6 changed files with 224 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.wifi.WxMpWifiShopDataResult;
import me.chanjar.weixin.mp.bean.wifi.WxMpWifiShopListResult;
/**
@@ -21,8 +22,27 @@ public interface WxMpWifiService {
* http请求方式: POST
* 请求URLhttps://api.weixin.qq.com/bizwifi/shop/list?access_token=ACCESS_TOKEN
* </pre>
* @param pageIndex 分页下标默认从1开始
*
* @param pageIndex 分页下标默认从1开始
* @param pageSize 每页的个数默认10个最大20个
* @return 结果
* @throws WxErrorException 异常
*/
WxMpWifiShopListResult listShop(int pageIndex, int pageSize) throws WxErrorException;
/**
* <pre>
* 查询门店Wi-Fi信息
* 通过此接口查询某一门店的详细Wi-Fi信息包括门店内的设备类型、ssid、密码、设备数量、商家主页URL、顶部常驻入口文案。
*
* http请求方式: POST
* 请求URLhttps://api.weixin.qq.com/bizwifi/shop/get?access_token=ACCESS_TOKEN
* POST数据格式JSON
* </pre>
*
* @param shopId 门店ID
* @return 结果
* @throws WxErrorException 异常
*/
WxMpWifiShopDataResult getShopWifiInfo(int shopId) throws WxErrorException;
}

View File

@@ -5,10 +5,11 @@ import lombok.RequiredArgsConstructor;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.WxMpWifiService;
import me.chanjar.weixin.mp.bean.wifi.WxMpWifiShopDataResult;
import me.chanjar.weixin.mp.bean.wifi.WxMpWifiShopListResult;
import me.chanjar.weixin.mp.enums.WxMpApiUrl;
import static me.chanjar.weixin.mp.enums.WxMpApiUrl.Wifi.*;
import static me.chanjar.weixin.mp.enums.WxMpApiUrl.Wifi.BIZWIFI_SHOP_GET;
import static me.chanjar.weixin.mp.enums.WxMpApiUrl.Wifi.BIZWIFI_SHOP_LIST;
/**
* <pre>
@@ -29,4 +30,11 @@ public class WxMpWifiServiceImpl implements WxMpWifiService {
final String result = this.wxMpService.post(BIZWIFI_SHOP_LIST, json.toString());
return WxMpWifiShopListResult.fromJson(result);
}
@Override
public WxMpWifiShopDataResult getShopWifiInfo(int shopId) throws WxErrorException {
JsonObject json = new JsonObject();
json.addProperty("shop_id", shopId);
return WxMpWifiShopDataResult.fromJson(this.wxMpService.post(BIZWIFI_SHOP_GET, json.toString()));
}
}