🆕 #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

@ -13,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.api.WxImgProcService;
import me.chanjar.weixin.common.api.WxOcrService;
import me.chanjar.weixin.common.bean.ToJson;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxError;
@ -186,7 +187,15 @@ public abstract class BaseWxMaServiceImpl<H, P> implements WxMaService, RequestH
public String post(String url, Object obj) throws WxErrorException {
return this.execute(SimplePostRequestExecutor.create(this), url, WxGsonBuilder.create().toJson(obj));
}
@Override
public String post(String url, ToJson obj) throws WxErrorException {
return this.post(url, obj.toJson());
}
@Override
public String post(String url, JsonObject jsonObject) throws WxErrorException {
return this.post(url, jsonObject.toString());
}
/**
* 向微信端发送请求在这里执行的策略是当发生access_token过期时才去刷新然后重新执行请求而不是全局定时请求
*/

View File

@ -43,7 +43,7 @@ public class WxMaOcrServiceImpl implements WxOcrService {
// ignore cannot happen
}
final String result = this.mainService.post(String.format(IDCARD, imgUrl), null);
final String result = this.mainService.post(String.format(IDCARD, imgUrl), (String) null);
return WxOcrIdCardResult.fromJson(result);
}
@ -62,7 +62,7 @@ public class WxMaOcrServiceImpl implements WxOcrService {
// ignore cannot happen
}
final String result = this.mainService.post(String.format(BANK_CARD, imgUrl), null);
final String result = this.mainService.post(String.format(BANK_CARD, imgUrl), (String) null);
return WxOcrBankCardResult.fromJson(result);
}
@ -81,7 +81,7 @@ public class WxMaOcrServiceImpl implements WxOcrService {
// ignore cannot happen
}
final String result = this.mainService.post(String.format(DRIVING, imgUrl), null);
final String result = this.mainService.post(String.format(DRIVING, imgUrl), (String) null);
return WxOcrDrivingResult.fromJson(result);
}
@ -100,7 +100,7 @@ public class WxMaOcrServiceImpl implements WxOcrService {
// ignore cannot happen
}
final String result = this.mainService.post(String.format(DRIVING_LICENSE, imgUrl), null);
final String result = this.mainService.post(String.format(DRIVING_LICENSE, imgUrl), (String) null);
return WxOcrDrivingLicenseResult.fromJson(result);
}
@ -119,7 +119,7 @@ public class WxMaOcrServiceImpl implements WxOcrService {
// ignore cannot happen
}
final String result = this.mainService.post(String.format(BIZ_LICENSE, imgUrl), null);
final String result = this.mainService.post(String.format(BIZ_LICENSE, imgUrl), (String) null);
return WxOcrBizLicenseResult.fromJson(result);
}
@ -138,7 +138,7 @@ public class WxMaOcrServiceImpl implements WxOcrService {
// ignore cannot happen
}
final String result = this.mainService.post(String.format(COMM, imgUrl), null);
final String result = this.mainService.post(String.format(COMM, imgUrl), (String) null);
return WxOcrCommResult.fromJson(result);
}