File tree Expand file tree Collapse file tree 3 files changed +31
-2
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 +31
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ public interface WxMpStoreService {
27
27
*/
28
28
void add (WxMpStoreBaseInfo request ) throws WxErrorException ;
29
29
30
-
31
30
/**
32
31
* <pre>
33
32
* 查询门店信息
@@ -63,4 +62,15 @@ public interface WxMpStoreService {
63
62
* @throws WxErrorException
64
63
*/
65
64
List <WxMpStoreInfo > listAll () throws WxErrorException ;
65
+
66
+ /**
67
+ * <pre>
68
+ * 修改门店服务信息
69
+ * 商户可以通过该接口,修改门店的服务信息,包括:sid、图片列表、营业时间、推荐、特色服务、简介、人均价格、电话8个字段(名称、坐标、地址等不可修改)修改后需要人工审核。
70
+ * 详情请见: <a href="https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN">微信门店接口</a>
71
+ * </pre>
72
+ * @throws WxErrorException
73
+ */
74
+ void update (WxMpStoreBaseInfo info ) throws WxErrorException ;
75
+
66
76
}
Original file line number Diff line number Diff line change @@ -117,4 +117,14 @@ public List<WxMpStoreInfo> listAll() throws WxErrorException {
117
117
return stores ;
118
118
}
119
119
120
+ @ Override
121
+ public void update (WxMpStoreBaseInfo request ) throws WxErrorException {
122
+ String url = API_BASE_URL + "/updatepoi" ;
123
+ String response = this .wxMpService .post (url , request .toJson ());
124
+ WxError wxError = WxError .fromJson (response );
125
+ if (wxError .getErrorCode () != 0 ) {
126
+ throw new WxErrorException (wxError );
127
+ }
128
+ }
129
+
120
130
}
Original file line number Diff line number Diff line change 15
15
import static org .junit .Assert .assertNotNull ;
16
16
17
17
/**
18
- * @author 王彬 (Binary Wang)
18
+ * @author binarywang(https://github.com/binarywang)
19
+ * Created by Binary Wang on 2016-09-23.
19
20
*
20
21
*/
21
22
@ Test
@@ -37,6 +38,14 @@ public void testAdd() throws WxErrorException {
37
38
.build ());
38
39
}
39
40
41
+ public void testUpdate () throws WxErrorException {
42
+ this .wxMpService .getStoreService ()
43
+ .update (WxMpStoreBaseInfo .builder ().poiId ("291503654" ).telephone ("020-12345678" )
44
+ .sid ("aaa" ).avgPrice (35 ).openTime ("8:00-20:00" ).special ("免费wifi,外卖服务" )
45
+ .introduction ("麦当劳是全球大型跨国连锁餐厅,1940 年创立于美国,在世界上大约拥有3 万间分店。主要售卖汉堡包,以及薯条、炸鸡、汽水、冰品、沙拉、水果等快餐食品" ).offsetType (1 )
46
+ .build ());
47
+ }
48
+
40
49
public void testGet () throws WxErrorException {
41
50
WxMpStoreBaseInfo result = this .wxMpService .getStoreService ().get ("291503654" );
42
51
assertNotNull (result );
You can’t perform that action at this time.
0 commit comments