cn.binarywang.wx.miniapp.api.WxMaJsapiService Maven / Gradle / Ivy
package cn.binarywang.wx.miniapp.api;
import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.common.error.WxErrorException;
/**
*
* jsapi相关接口
* Created by BinaryWang on 2018/8/5.
*
*
* @author Binary Wang
*/
public interface WxMaJsapiService {
/**
* 获得卡券api_ticket,不强制刷新api_ticket
*
* @return the card api ticket
* @throws WxErrorException the wx error exception
* @see #getJsapiTicket(boolean) #getJsapiTicket(boolean)
*/
String getCardApiTicket() throws WxErrorException;
/**
*
* 获得卡券api_ticket
* 获得时会检查apiToken是否过期,如果过期了,那么就刷新一下,否则就什么都不干
*
* 详情请见:http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115&token=&lang=zh_CN
*
*
* @param forceRefresh 强制刷新
* @return the card api ticket
* @throws WxErrorException the wx error exception
*/
String getCardApiTicket(boolean forceRefresh) throws WxErrorException;
/**
* 获得jsapi_ticket,不强制刷新jsapi_ticket
*
* @return the jsapi ticket
* @throws WxErrorException the wx error exception
* @see #getJsapiTicket(boolean) #getJsapiTicket(boolean)
*/
String getJsapiTicket() throws WxErrorException;
/**
*
* 获得jsapi_ticket
* 获得时会检查jsapiToken是否过期,如果过期了,那么就刷新一下,否则就什么都不干
*
* 详情请见:http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115&token=&lang=zh_CN
*
*
* @param forceRefresh 强制刷新
* @return the jsapi ticket
* @throws WxErrorException the wx error exception
*/
String getJsapiTicket(boolean forceRefresh) throws WxErrorException;
/**
*
* 创建调用jsapi时所需要的签名
*
* 详情请见:http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115&token=&lang=zh_CN
*
*
* @param url the url
* @return the wx jsapi signature
* @throws WxErrorException the wx error exception
*/
WxJsapiSignature createJsapiSignature(String url) throws WxErrorException;
}