File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed
main/java/me/chanjar/weixin/mp/api
test/java/me/chanjar/weixin/mp/api/impl Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -36,11 +36,22 @@ public interface WxMpStoreService {
36
36
* 注:扩展字段为公共编辑信息(大家都可修改),修改将会审核,并决定是否对修改建议进行采纳,但不会影响该门店的生效可用状态。
37
37
* 详情请见: <a href="https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN">微信门店接口</a>
38
38
* </pre>
39
- * @param poiId 门店poiId
39
+ * @param poiId 门店Id
40
40
* @throws WxErrorException
41
41
*/
42
42
WxMpStoreBaseInfo get (String poiId ) throws WxErrorException ;
43
43
44
+ /**
45
+ * <pre>
46
+ * 删除门店
47
+ * 商户可以通过该接口,删除已经成功创建的门店。请商户慎重调用该接口。
48
+ * 详情请见: <a href="https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN">微信门店接口</a>
49
+ * </pre>
50
+ * @param poiId 门店Id
51
+ * @throws WxErrorException
52
+ */
53
+ void delete (String poiId ) throws WxErrorException ;
54
+
44
55
/**
45
56
* <pre>
46
57
* 查询门店列表(指定查询起始位置和个数)
Original file line number Diff line number Diff line change @@ -57,6 +57,18 @@ public WxMpStoreBaseInfo get(String poiId) throws WxErrorException {
57
57
.get ("business" ).getAsJsonObject ().get ("base_info" ).toString ());
58
58
}
59
59
60
+ @ Override
61
+ public void delete (String poiId ) throws WxErrorException {
62
+ String url = API_BASE_URL + "/delpoi" ;
63
+ JsonObject paramObject = new JsonObject ();
64
+ paramObject .addProperty ("poi_id" ,poiId );
65
+ String response = this .wxMpService .post (url , paramObject .toString ());
66
+ WxError wxError = WxError .fromJson (response );
67
+ if (wxError .getErrorCode () != 0 ) {
68
+ throw new WxErrorException (wxError );
69
+ }
70
+ }
71
+
60
72
private void checkParameters (WxMpStoreBaseInfo request ) {
61
73
List <String > nullFields = Lists .newArrayList ();
62
74
for (Entry <String , Reflect > entry : Reflect .on (request ).fields ()
Original file line number Diff line number Diff line change @@ -52,6 +52,10 @@ public void testGet() throws WxErrorException {
52
52
System .err .println (result );
53
53
}
54
54
55
+ public void testDelete () throws WxErrorException {
56
+ this .wxMpService .getStoreService ().delete ("463558057" );
57
+ }
58
+
55
59
public void testList () throws WxErrorException {
56
60
WxMpStoreListResult result = this .wxMpService .getStoreService ().list (0 , 10 );
57
61
assertNotNull (result );
You can’t perform that action at this time.
0 commit comments