mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-27 20:14:52 +08:00
🆕 #1686 微信公众号增加对话能力(原导购助手)部分接口,如添加顾问、获取顾问信息等
This commit is contained in:
@ -22,6 +22,11 @@ public class WxErrorException extends Exception {
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
public WxErrorException(Throwable cause) {
|
||||
super(cause.getMessage(), cause);
|
||||
this.error = WxError.builder().errorCode(-1).errorMsg(cause.getMessage()).build();
|
||||
}
|
||||
|
||||
public WxError getError() {
|
||||
return this.error;
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package me.chanjar.weixin.common.service;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import me.chanjar.weixin.common.bean.ToJson;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
|
||||
/**
|
||||
@ -38,4 +40,24 @@ public interface WxService {
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
String post(String url, Object obj) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 当本Service没有实现某个API的时候,可以用这个,针对所有微信API中的POST请求.
|
||||
*
|
||||
* @param url 请求接口地址
|
||||
* @param jsonObject 请求对象
|
||||
* @return 接口响应字符串
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
String post(String url, JsonObject jsonObject) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 当本Service没有实现某个API的时候,可以用这个,针对所有微信API中的POST请求.
|
||||
*
|
||||
* @param url 请求接口地址
|
||||
* @param obj 请求对象,实现了ToJson接口
|
||||
* @return 接口响应字符串
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
String post(String url, ToJson obj) throws WxErrorException;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user