@@ -23,4 +23,29 @@ public WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, String appId) {
2323 public WxMpXmlOutMessage route (final WxMpXmlMessage wxMessage , final Map <String , Object > context , String appId ) {
2424 return route (wxMessage , context , wxOpenService .getWxOpenComponentService ().getWxMpServiceByAppid (appId ));
2525 }
26+
27+ /**
28+ * 路由微信消息到小程序服务 (Route WeChat message to Mini App service)
29+ *
30+ * @param wxMessage the wx message
31+ * @param appId the app id
32+ * @return the wx mp xml out message
33+ */
34+ public WxMpXmlOutMessage routeForMa (final WxMpXmlMessage wxMessage , String appId ) {
35+ return routeForMa (wxMessage , new HashMap <>(), appId );
36+ }
37+
38+ /**
39+ * 路由微信消息到小程序服务 (Route WeChat message to Mini App service)
40+ *
41+ * @param wxMessage the wx message
42+ * @param context the context
43+ * @param appId the app id
44+ * @return the wx mp xml out message
45+ */
46+ public WxMpXmlOutMessage routeForMa (final WxMpXmlMessage wxMessage , final Map <String , Object > context , String appId ) {
47+ // 将小程序服务放入上下文中,以便处理器可以访问 (Put Mini App service in context so handlers can access it)
48+ context .put ("wxOpenMaService" , wxOpenService .getWxOpenComponentService ().getWxMaServiceByAppid (appId ));
49+ return route (wxMessage , context , wxOpenService .getWxOpenComponentService ().getWxMpServiceByAppid (appId ));
50+ }
2651}
0 commit comments