File tree Expand file tree Collapse file tree
main/java/me/chanjar/weixin/mp/api
test/java/me/chanjar/weixin/mp/api/impl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ public interface WxMpStoreService {
2727 */
2828 void add (WxMpStoreBaseInfo request ) throws WxErrorException ;
2929
30-
3130 /**
3231 * <pre>
3332 * 查询门店信息
@@ -63,4 +62,15 @@ public interface WxMpStoreService {
6362 * @throws WxErrorException
6463 */
6564 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+
6676}
Original file line number Diff line number Diff line change @@ -117,4 +117,14 @@ public List<WxMpStoreInfo> listAll() throws WxErrorException {
117117 return stores ;
118118 }
119119
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+
120130}
Original file line number Diff line number Diff line change 1515import static org .junit .Assert .assertNotNull ;
1616
1717/**
18- * @author 王彬 (Binary Wang)
18+ * @author binarywang(https://github.com/binarywang)
19+ * Created by Binary Wang on 2016-09-23.
1920 *
2021 */
2122@ Test
@@ -37,6 +38,14 @@ public void testAdd() throws WxErrorException {
3738 .build ());
3839 }
3940
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+
4049 public void testGet () throws WxErrorException {
4150 WxMpStoreBaseInfo result = this .wxMpService .getStoreService ().get ("291503654" );
4251 assertNotNull (result );
You can’t perform that action at this time.
0 commit comments