public abstract class BaseWxMaServiceImpl<H,P> extends Object implements WxMaService, RequestHttp<H,P>
doGetAccessTokenRequest()
限定符和类型 | 字段和说明 |
---|---|
protected static com.google.gson.Gson |
GSON |
protected static String[] |
urlPathSupportApiSignature
开启API签名验证后需要API签名的接口,根据 https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/
整理,uri包含下这些字符串且配置了api signature aes ras key 自动用签名接口
|
GET_ACCESS_TOKEN_URL, GET_PAID_UNION_ID_URL, GET_STABLE_ACCESS_TOKEN, JSCODE_TO_SESSION_URL, SET_DYNAMIC_DATA_URL
构造器和说明 |
---|
BaseWxMaServiceImpl() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initHttp
getRequestHttpClient, getRequestHttpProxy, getRequestType
protected static final String[] urlPathSupportApiSignature
protected static final com.google.gson.Gson GSON
public RequestHttp getRequestHttp()
WxMaService
getRequestHttp
在接口中 WxMaService
public String getPaidUnionId(String openid, String transactionId, String mchId, String outTradeNo) throws WxErrorException
WxMaService
用户支付完成后,获取该用户的 UnionId,无需用户授权。本接口支持第三方平台代理查询。 注意:调用前需要用户完成支付,且在支付后的五分钟内有效。 请求地址: GET https://api.weixin.qq.com/wxa/getpaidunionid?access_token=ACCESS_TOKEN&openid=OPENID 文档地址:https://developers.weixin.qq.com/miniprogram/dev/api/getPaidUnionId.html
getPaidUnionId
在接口中 WxMaService
openid
- 必填 支付用户唯一标识transactionId
- 非必填 微信支付订单号mchId
- 非必填 微信支付分配的商户号,和商户订单号配合使用outTradeNo
- 非必填 微信支付商户订单号,和商户号配合使用WxErrorException
- .public WxMaJscode2SessionResult jsCode2SessionInfo(String jsCode) throws WxErrorException
WxMaService
jsCode2SessionInfo
在接口中 WxMaService
jsCode
- 登录时获取的 codeWxErrorException
- the wx error exceptionpublic void setDynamicData(int lifespan, String type, int scene, String data) throws WxErrorException
WxMaService
第三方通过调用微信API,将数据写入到setdynamicdata这个API。每个Post数据包不超过5K,若数据过多可开多进(线)程并发导入数据(例如:数据量为十万量级可以开50个线程并行导数据)。 文档地址:https://wsad.weixin.qq.com/wsad/zh_CN/htmledition/widget-docs-v3/html/custom/quickstart/implement/import/index.html http请求方式:POST http(s)://api.weixin.qq.com/wxa/setdynamicdata?access_token=ACCESS_TOKEN
setDynamicData
在接口中 WxMaService
lifespan
- 数据有效时间,秒为单位,一般为86400,一天一次导入的频率type
- 用于标识数据所属的服务类目scene
- 1代表用于搜索的数据data
- 推送到微信后台的数据列表,该数据被微信用于流量分配,注意该字段为string类型而不是objectWxErrorException
- .public boolean checkSignature(String timestamp, String nonce, String signature)
WxMaService
验证消息的确来自微信服务器. 详情请见: http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421135319&token=&lang=zh_CN
checkSignature
在接口中 WxMaService
timestamp
- the timestampnonce
- the noncesignature
- the signaturepublic String getAccessToken() throws WxErrorException
WxMaService
getAccessToken
在接口中 WxMaService
WxErrorException
- the wx error exception#getAccessToken(boolean)
public String getAccessToken(boolean forceRefresh) throws WxErrorException
WxMaService
获取access_token,本方法线程安全. 且在多线程同时刷新时只刷新一次,避免超出2000次/日的调用次数上限 另:本service的所有方法都会在access_token过期是调用此方法 程序员在非必要情况下尽量不要主动调用此方法 详情请见: http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140183&token=&lang=zh_CN
getAccessToken
在接口中 WxMaService
forceRefresh
- 强制刷新WxErrorException
- the wx error exceptionprotected abstract String doGetAccessTokenRequest() throws IOException
IOException
- .protected abstract String doGetStableAccessTokenRequest(boolean forceRefresh) throws IOException
IOException
- .public String get(String url, String queryParam) throws WxErrorException
get
在接口中 WxService
WxErrorException
public String post(String url, String postData) throws WxErrorException
post
在接口中 WxService
WxErrorException
public String post(String url, Object obj) throws WxErrorException
post
在接口中 WxService
WxErrorException
public String post(String url, ToJson obj) throws WxErrorException
post
在接口中 WxService
WxErrorException
public String post(String url, com.google.gson.JsonObject jsonObject) throws WxErrorException
post
在接口中 WxService
WxErrorException
public String upload(String url, CommonUploadParam param) throws WxErrorException
upload
在接口中 WxService
WxErrorException
public <R,T> R execute(RequestExecutor<R,T> executor, String uri, T data) throws WxErrorException
execute
在接口中 WxMaService
R
- .T
- .executor
- 执行器uri
- 接口请求地址data
- 参数或请求数据WxErrorException
- the wx error exceptionpublic WxMaApiResponse execute(ApiSignaturePostRequestExecutor executor, String uri, Map<String,String> headers, String data) throws WxErrorException
execute
在接口中 WxMaService
WxErrorException
protected String extractAccessToken(String resultContent) throws WxErrorException
resultContent
- 响应内容WxErrorException
- 异常public WxMaConfig getWxMaConfig()
WxMaService
getWxMaConfig
在接口中 WxMaService
public void setWxMaConfig(WxMaConfig maConfig)
WxMaService
WxMaConfig
的实现.setWxMaConfig
在接口中 WxMaService
maConfig
- configpublic void setMultiConfigs(Map<String,WxMaConfig> configs)
WxMaService
setMultiConfigs
在接口中 WxMaService
configs
- WxMaConfig mappublic void setMultiConfigs(Map<String,WxMaConfig> configs, String defaultMiniappId)
WxMaService
setMultiConfigs
在接口中 WxMaService
configs
- WxMaConfig mapdefaultMiniappId
- 设置一个WxMaConfig
所对应的defaultMiniappId
进行Http初始化public void addConfig(String miniappId, WxMaConfig configStorages)
WxMaService
WxMaConfig
,适用于动态添加新的微信公众号配置.addConfig
在接口中 WxMaService
miniappId
- 小程序标识configStorages
- 新的微信配置public void removeConfig(String miniappId)
WxMaService
miniappId
所对应的 WxMaConfig
,适用于动态移除小程序配置.removeConfig
在接口中 WxMaService
miniappId
- 对应小程序的标识public WxMaService switchoverTo(String miniAppId)
WxMaService
switchoverTo
在接口中 WxMaService
miniAppId
- 小程序标识public WxMaService switchoverTo(String miniAppId, java.util.function.Function<String,WxMaConfig> func)
WxMaService
switchoverTo
在接口中 WxMaService
miniAppId
- 小程序标识func
- 当对应的小程序配置不存在时,允许通过函数的方式进行调用获取public boolean switchover(String mpId)
WxMaService
switchover
在接口中 WxMaService
mpId
- 公众号标识public void setRetrySleepMillis(int retrySleepMillis)
WxMaService
设置当微信系统响应系统繁忙时,要等待多少 retrySleepMillis(ms) * 2^(重试次数 - 1) 再发起重试. 默认:1000ms
setRetrySleepMillis
在接口中 WxMaService
retrySleepMillis
- 重试等待毫秒数public void setMaxRetryTimes(int maxRetryTimes)
WxMaService
设置当微信系统响应系统繁忙时,最大重试次数. 默认:5次
setMaxRetryTimes
在接口中 WxMaService
maxRetryTimes
- 最大重试次数public WxMaMsgService getMsgService()
WxMaService
getMsgService
在接口中 WxMaService
public WxMaMediaService getMediaService()
WxMaService
getMediaService
在接口中 WxMaService
public WxMaUserService getUserService()
WxMaService
getUserService
在接口中 WxMaService
public WxMaQrcodeService getQrcodeService()
WxMaService
getQrcodeService
在接口中 WxMaService
public WxMaSchemeService getWxMaSchemeService()
WxMaService
getWxMaSchemeService
在接口中 WxMaService
public WxMaSubscribeService getSubscribeService()
WxMaService
getSubscribeService
在接口中 WxMaService
public WxMaAnalysisService getAnalysisService()
WxMaService
getAnalysisService
在接口中 WxMaService
public WxMaCodeService getCodeService()
WxMaService
getCodeService
在接口中 WxMaService
public WxMaJsapiService getJsapiService()
WxMaService
getJsapiService
在接口中 WxMaService
public WxMaSettingService getSettingService()
WxMaService
getSettingService
在接口中 WxMaService
public WxMaShareService getShareService()
WxMaService
getShareService
在接口中 WxMaService
public WxMaRunService getRunService()
WxMaService
getRunService
在接口中 WxMaService
public WxMaSecurityService getSecurityService()
WxMaService
getSecurityService
在接口中 WxMaService
public WxMaPluginService getPluginService()
WxMaService
getPluginService
在接口中 WxMaService
public WxMaExpressService getExpressService()
WxMaService
getExpressService
在接口中 WxMaService
public WxMaCloudService getCloudService()
WxMaService
getCloudService
在接口中 WxMaService
public WxMaInternetService getInternetService()
WxMaService
getInternetService
在接口中 WxMaService
public WxMaLiveService getLiveService()
WxMaService
getLiveService
在接口中 WxMaService
public WxMaLiveGoodsService getLiveGoodsService()
WxMaService
getLiveGoodsService
在接口中 WxMaService
public WxMaLiveMemberService getLiveMemberService()
WxMaService
getLiveMemberService
在接口中 WxMaService
public WxOcrService getOcrService()
WxMaService
getOcrService
在接口中 WxMaService
public WxImgProcService getImgProcService()
WxMaService
getImgProcService
在接口中 WxMaService
public WxMaShopSpuService getShopSpuService()
WxMaService
getShopSpuService
在接口中 WxMaService
public WxMaShopOrderService getShopOrderService()
WxMaService
getShopOrderService
在接口中 WxMaService
public WxMaShopRegisterService getShopRegisterService()
WxMaService
getShopRegisterService
在接口中 WxMaService
public WxMaShopAccountService getShopAccountService()
WxMaService
getShopAccountService
在接口中 WxMaService
public WxMaShopCatService getShopCatService()
WxMaService
getShopCatService
在接口中 WxMaService
public WxMaShopImgService getShopImgService()
WxMaService
getShopImgService
在接口中 WxMaService
public WxMaShopAuditService getShopAuditService()
WxMaService
getShopAuditService
在接口中 WxMaService
public WxMaShopAfterSaleService getShopAfterSaleService()
WxMaService
getShopAfterSaleService
在接口中 WxMaService
public WxMaShopDeliveryService getShopDeliveryService()
WxMaService
getShopDeliveryService
在接口中 WxMaService
public WxMaLinkService getLinkService()
WxMaService
getLinkService
在接口中 WxMaService
public WxMaReimburseInvoiceService getReimburseInvoiceService()
WxMaService
getReimburseInvoiceService
在接口中 WxMaService
public WxMaDeviceSubscribeService getDeviceSubscribeService()
WxMaService
getDeviceSubscribeService
在接口中 WxMaService
public WxMaMarketingService getMarketingService()
WxMaService
getMarketingService
在接口中 WxMaService
public WxMaImmediateDeliveryService getWxMaImmediateDeliveryService()
WxMaService
getWxMaImmediateDeliveryService
在接口中 WxMaService
public WxMaShopSharerService getShopSharerService()
WxMaService
getShopSharerService
在接口中 WxMaService
public WxMaProductService getProductService()
WxMaService
getProductService
在接口中 WxMaService
public WxMaProductOrderService getProductOrderService()
WxMaService
getProductOrderService
在接口中 WxMaService
public WxMaShopCouponService getWxMaShopCouponService()
WxMaService
getWxMaShopCouponService
在接口中 WxMaService
public WxMaShopPayService getWxMaShopPayService()
WxMaService
getWxMaShopPayService
在接口中 WxMaService
public WxMaOrderShippingService getWxMaOrderShippingService()
getWxMaOrderShippingService
在接口中 WxMaService
public WxMaOpenApiService getWxMaOpenApiService()
WxMaService
getWxMaOpenApiService
在接口中 WxMaService
public WxMaVodService getWxMaVodService()
WxMaService
getWxMaVodService
在接口中 WxMaService
public WxMaXPayService getWxMaXPayService()
WxMaService
getWxMaXPayService
在接口中 WxMaService
public WxMaExpressDeliveryReturnService getWxMaExpressDeliveryReturnService()
public WxMaPromotionService getWxMaPromotionService()
WxMaService
getWxMaPromotionService
在接口中 WxMaService
public String postWithSignature(String url, Object obj) throws WxErrorException
postWithSignature
在接口中 WxMaService
WxErrorException
public String postWithSignature(String url, com.google.gson.JsonObject jsonObject) throws WxErrorException
postWithSignature
在接口中 WxMaService
WxErrorException
public WxMaIntracityService getIntracityService()
WxMaService
getIntracityService
在接口中 WxMaService
Copyright © 2024. All rights reserved.