🆕 【开放平台】接入小程序认证(年审)相关接口,同时增加公共的文件上传方法
This commit is contained in:
@@ -2,36 +2,19 @@ package me.chanjar.weixin.channel.api.impl;
|
||||
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.channel.api.WxChannelAddressService;
|
||||
import me.chanjar.weixin.channel.api.WxChannelAfterSaleService;
|
||||
import me.chanjar.weixin.channel.api.WxChannelBasicService;
|
||||
import me.chanjar.weixin.channel.api.WxChannelBrandService;
|
||||
import me.chanjar.weixin.channel.api.WxChannelCategoryService;
|
||||
import me.chanjar.weixin.channel.api.WxChannelCouponService;
|
||||
import me.chanjar.weixin.channel.api.WxChannelFreightTemplateService;
|
||||
import me.chanjar.weixin.channel.api.WxChannelFundService;
|
||||
import me.chanjar.weixin.channel.api.WxChannelOrderService;
|
||||
import me.chanjar.weixin.channel.api.WxChannelProductService;
|
||||
import me.chanjar.weixin.channel.api.WxChannelService;
|
||||
import me.chanjar.weixin.channel.api.WxChannelSharerService;
|
||||
import me.chanjar.weixin.channel.api.WxChannelWarehouseService;
|
||||
import me.chanjar.weixin.channel.api.WxLeagueProductService;
|
||||
import me.chanjar.weixin.channel.api.WxLeaguePromoterService;
|
||||
import me.chanjar.weixin.channel.api.WxLeagueSupplierService;
|
||||
import me.chanjar.weixin.channel.api.WxLeagueWindowService;
|
||||
import me.chanjar.weixin.channel.api.*;
|
||||
import me.chanjar.weixin.channel.config.WxChannelConfig;
|
||||
import me.chanjar.weixin.channel.util.JsonUtils;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.common.bean.CommonUploadParam;
|
||||
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;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.common.error.WxRuntimeException;
|
||||
import me.chanjar.weixin.common.executor.CommonUploadRequestExecutor;
|
||||
import me.chanjar.weixin.common.util.DataUtils;
|
||||
import me.chanjar.weixin.common.util.crypto.SHA1;
|
||||
import me.chanjar.weixin.common.util.http.RequestExecutor;
|
||||
@@ -40,6 +23,10 @@ import me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor;
|
||||
import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
|
||||
/**
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
* @see #doGetAccessTokenRequest
|
||||
@@ -119,7 +106,6 @@ public abstract class BaseWxChannelServiceImpl<H, P> implements WxChannelService
|
||||
* 通过网络请求获取AccessToken
|
||||
*
|
||||
* @return .
|
||||
*
|
||||
* @throws IOException .
|
||||
*/
|
||||
protected abstract String doGetAccessTokenRequest() throws IOException;
|
||||
@@ -145,6 +131,12 @@ public abstract class BaseWxChannelServiceImpl<H, P> implements WxChannelService
|
||||
return this.post(url, obj.toJson());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String upload(String url, CommonUploadParam param) throws WxErrorException {
|
||||
RequestExecutor<String, CommonUploadParam> executor = CommonUploadRequestExecutor.create(getRequestHttp());
|
||||
return this.execute(executor, url, param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String post(String url, JsonObject jsonObject) throws WxErrorException {
|
||||
return this.post(url, jsonObject.toString());
|
||||
@@ -200,7 +192,7 @@ public abstract class BaseWxChannelServiceImpl<H, P> implements WxChannelService
|
||||
}
|
||||
|
||||
protected <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E data, boolean doNotAutoRefreshToken,
|
||||
boolean printResult) throws WxErrorException {
|
||||
boolean printResult) throws WxErrorException {
|
||||
E dataForLog = DataUtils.handleDataWithSecret(data);
|
||||
|
||||
if (uri.contains("access_token=")) {
|
||||
@@ -259,7 +251,6 @@ public abstract class BaseWxChannelServiceImpl<H, P> implements WxChannelService
|
||||
*
|
||||
* @param resultContent 响应内容
|
||||
* @return access token
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
protected String extractAccessToken(String resultContent) throws WxErrorException {
|
||||
@@ -372,7 +363,7 @@ public abstract class BaseWxChannelServiceImpl<H, P> implements WxChannelService
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized WxLeaguePromoterService getLeaguePromoterService() {
|
||||
public synchronized WxLeaguePromoterService getLeaguePromoterService() {
|
||||
if (leaguePromoterService == null) {
|
||||
leaguePromoterService = new WxLeaguePromoterServiceImpl(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user