This commit is contained in:
Daniel Qian 2014-11-03 21:51:12 +08:00
parent a44c18ade6
commit a49f834188
2 changed files with 17 additions and 0 deletions

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

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);
}