🆕 #1686 微信公众号增加对话能力(原导购助手)部分接口,如添加顾问、获取顾问信息等

This commit is contained in:
Binary Wang
2020-10-06 21:04:39 +08:00
parent 64402ab1de
commit 6948044ab9
15 changed files with 389 additions and 121 deletions

View File

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

View File

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