File tree Expand file tree Collapse file tree
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -318,6 +318,17 @@ public interface WxMpService {
318318 */
319319 public void templateSend (WxMpTemplateMessage templateMessage ) throws WxErrorException ;
320320
321+ /**
322+ * <pre>
323+ * 语义查询接口
324+ * 详情请见:http://mp.weixin.qq.com/wiki/index.php?title=语义理解
325+ * </pre>
326+ * @param semanticQuery
327+ * @return
328+ * @throws WxErrorException
329+ */
330+ WxMpSemanticQueryResult semanticQuery (WxMpSemanticQuery semanticQuery ) throws WxErrorException ;
331+
321332 /**
322333 * 当本Service没有实现某个API的时候,可以用这个,针对所有微信API中的GET请求
323334 * @param url
Original file line number Diff line number Diff line change @@ -293,6 +293,12 @@ public void templateSend(WxMpTemplateMessage templateMessage) throws WxErrorExce
293293 execute (new SimplePostRequestExecutor (), url , templateMessage .toJson ());
294294 }
295295
296+ public WxMpSemanticQueryResult semanticQuery (WxMpSemanticQuery semanticQuery ) throws WxErrorException {
297+ String url = "https://api.weixin.qq.com/semantic/semproxy/search" ;
298+ String responseContent = execute (new SimplePostRequestExecutor (), url , semanticQuery .toJson ());
299+ return WxMpSemanticQueryResult .fromJson (responseContent );
300+ }
301+
296302 public String get (String url , String queryParam ) throws WxErrorException {
297303 return execute (new SimpleGetRequestExecutor (), url , queryParam );
298304 }
You can’t perform that action at this time.
0 commit comments