Browse Source

issue #28

master
Daniel Qian 10 years ago
parent
commit
a49f834188
2 changed files with 17 additions and 0 deletions
  1. +11
    -0
      weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpService.java
  2. +6
    -0
      weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpServiceImpl.java

+ 11
- 0
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpService.java View File

@@ -318,6 +318,17 @@ public interface WxMpService {
*/
public void templateSend(WxMpTemplateMessage templateMessage) throws WxErrorException;

/**
* <pre>
* 语义查询接口
* 详情请见:http://mp.weixin.qq.com/wiki/index.php?title=语义理解
* </pre>
* @param semanticQuery
* @return
* @throws WxErrorException
*/
WxMpSemanticQueryResult semanticQuery(WxMpSemanticQuery semanticQuery) throws WxErrorException;

/**
* 当本Service没有实现某个API的时候,可以用这个,针对所有微信API中的GET请求
* @param url


+ 6
- 0
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpServiceImpl.java View File

@@ -293,6 +293,12 @@ public class WxMpServiceImpl implements WxMpService {
execute(new SimplePostRequestExecutor(), url, templateMessage.toJson());
}

public WxMpSemanticQueryResult semanticQuery(WxMpSemanticQuery semanticQuery) throws WxErrorException {
String url = "https://api.weixin.qq.com/semantic/semproxy/search";
String responseContent = execute(new SimplePostRequestExecutor(), url, semanticQuery.toJson());
return WxMpSemanticQueryResult.fromJson(responseContent);
}

public String get(String url, String queryParam) throws WxErrorException {
return execute(new SimpleGetRequestExecutor(), url, queryParam);
}


Loading…
Cancel
Save