public interface WxMaService extends WxService
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
GET_ACCESS_TOKEN_URL
获取access_token.
|
static String |
GET_PAID_UNION_ID_URL
getPaidUnionId
|
static String |
GET_STABLE_ACCESS_TOKEN |
static String |
JSCODE_TO_SESSION_URL
The constant JSCODE_TO_SESSION_URL.
|
static String |
SET_DYNAMIC_DATA_URL
导入抽样数据
|
static final String JSCODE_TO_SESSION_URL
WxMaJscode2SessionResult jsCode2SessionInfo(String jsCode) throws WxErrorException
jsCode - 登录时获取的 codeWxErrorException - 调用微信接口失败时抛出void setDynamicData(int lifespan,
String type,
int scene,
String data)
throws WxErrorException
lifespan - 数据有效时间(秒),如 86400 表示一天type - 数据所属服务类目标识scene - 场景值,1 代表用于搜索的数据data - 推送到微信后台的数据列表(字符串类型)WxErrorException - 调用微信接口失败时抛出boolean checkSignature(String timestamp, String nonce, String signature)
timestamp - 时间戳nonce - 随机数signature - 签名字符串String getAccessToken() throws WxErrorException
WxErrorException - 调用微信接口失败时抛出getAccessToken(boolean)String getAccessToken(boolean forceRefresh) throws WxErrorException
forceRefresh - 是否强制刷新WxErrorException - 调用微信接口失败时抛出String getPaidUnionId(String openid, String transactionId, String mchId, String outTradeNo) throws WxErrorException
openid - 支付用户唯一标识(必填)transactionId - 微信支付订单号(可选)mchId - 微信支付分配的商户号,与商户订单号配合使用(可选)outTradeNo - 微信支付商户订单号,与商户号配合使用(可选)WxErrorException - 调用微信接口失败时抛出<T,E> T execute(RequestExecutor<T,E> executor, String uri, E data) throws WxErrorException
WxService.get(java.lang.String, java.lang.String)和WxService.post(java.lang.String, java.lang.String)方法更灵活,可以自己构造RequestExecutor用来处理不同的参数和不同的返回类型。
可以参考 MediaUploadRequestExecutor 的实现方法。T - 返回的数据类型E - 请求参数的数据类型executor - 执行器对象uri - 接口请求地址data - 请求参数或数据WxErrorException - 微信接口调用异常WxMaApiResponse execute(ApiSignaturePostRequestExecutor<?,?> executor, String uri, Map<String,String> headers, String data) throws WxErrorException
executor - 签名请求执行器uri - 接口请求地址headers - 请求头信息data - 请求数据WxErrorException - 微信接口调用异常void setRetrySleepMillis(int retrySleepMillis)
retrySleepMillis - 重试等待的毫秒数,默认1000msvoid setMaxRetryTimes(int maxRetryTimes)
maxRetryTimes - 最大重试次数,默认5次WxMaConfig getWxMaConfig()
void setWxMaConfig(WxMaConfig maConfig)
maConfig - 小程序配置信息对象void addConfig(String miniappId, WxMaConfig configStorage)
miniappId - 小程序唯一标识configStorage - 新的小程序配置信息void removeConfig(String miniappId)
miniappId - 小程序唯一标识void setMultiConfigs(Map<String,WxMaConfig> configs)
configs - 小程序配置Map,key为小程序标识void setMultiConfigs(Map<String,WxMaConfig> configs, String defaultMiniappId)
configs - 小程序配置Map,key为小程序标识defaultMiniappId - 默认小程序标识boolean switchover(String mpId)
mpId - 公众号标识WxMaService switchoverTo(String miniAppId)
miniAppId - 小程序标识WxMaService switchoverTo(String miniAppId, java.util.function.Function<String,WxMaConfig> func)
miniAppId - 小程序标识func - 获取配置的函数WxMaMsgService getMsgService()
WxMaMediaService getMediaService()
WxMaUserService getUserService()
WxMaQrcodeService getQrcodeService()
WxMaSchemeService getWxMaSchemeService()
WxMaSubscribeService getSubscribeService()
WxMaAnalysisService getAnalysisService()
WxMaCodeService getCodeService()
WxMaCustomserviceWorkService getCustomserviceWorkService()
WxMaJsapiService getJsapiService()
WxMaSettingService getSettingService()
WxMaShareService getShareService()
WxMaRunService getRunService()
WxMaSecurityService getSecurityService()
WxMaPluginService getPluginService()
void initHttp()
RequestHttp<?,?> getRequestHttp()
WxMaExpressService getExpressService()
WxMaCloudService getCloudService()
WxMaInternetService getInternetService()
WxMaLiveService getLiveService()
WxMaLiveGoodsService getLiveGoodsService()
WxMaLiveMemberService getLiveMemberService()
WxOcrService getOcrService()
WxImgProcService getImgProcService()
WxMaShopAfterSaleService getShopAfterSaleService()
WxMaShopDeliveryService getShopDeliveryService()
WxMaShopOrderService getShopOrderService()
WxMaShopSpuService getShopSpuService()
WxMaShopRegisterService getShopRegisterService()
WxMaShopAccountService getShopAccountService()
WxMaShopCatService getShopCatService()
WxMaShopImgService getShopImgService()
WxMaShopAuditService getShopAuditService()
WxMaLinkService getLinkService()
WxMaReimburseInvoiceService getReimburseInvoiceService()
WxMaDeviceSubscribeService getDeviceSubscribeService()
WxMaMarketingService getMarketingService()
WxMaImmediateDeliveryService getWxMaImmediateDeliveryService()
WxMaShopSharerService getShopSharerService()
WxMaProductService getProductService()
WxMaProductOrderService getProductOrderService()
WxMaShopCouponService getWxMaShopCouponService()
WxMaShopPayService getWxMaShopPayService()
WxMaOrderShippingService getWxMaOrderShippingService()
WxMaOrderManagementService getWxMaOrderManagementService()
WxMaOpenApiService getWxMaOpenApiService()
WxMaVodService getWxMaVodService()
WxMaXPayService getWxMaXPayService()
WxMaExpressDeliveryReturnService getWxMaExpressDeliveryReturnService()
WxMaPromotionService getWxMaPromotionService()
String postWithSignature(String url, Object obj) throws WxErrorException
url - 请求地址obj - 请求对象WxErrorException - 微信接口调用异常String postWithSignature(String url, com.google.gson.JsonObject jsonObject) throws WxErrorException
url - 请求地址jsonObject - 请求的Json对象WxErrorException - 微信接口调用异常WxMaIntracityService getIntracityService()
Copyright © 2025. All rights reserved.