mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-04-23 23:58:44 +08:00
issue #28
This commit is contained in:
parent
a44c18ade6
commit
a49f834188
@ -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
|
||||
|
@ -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…
Reference in New Issue
Block a user