forked from binarywang/WxJava
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWxMaInternetService.java
43 lines (40 loc) · 1.92 KB
/
WxMaInternetService.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package cn.binarywang.wx.miniapp.api;
import cn.binarywang.wx.miniapp.bean.internet.WxMaInternetResponse;
import me.chanjar.weixin.common.error.WxErrorException;
/**
* <pre>
* 【小程序-服务端-网络】网络相关接口.
* 文档地址:https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/internet/internet.getUserEncryptKey.html
* </pre>
*
* @author <a href="https://github.com/chutian0124">chutian0124</a>
*/
public interface WxMaInternetService {
/**
* <pre>
* 获取用户encryptKey。 会获取用户最近3次的key,每个key的存活时间为3600s。
* 文档地址:https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/internet/internet.getUserEncryptKey.html
* 接口地址:POST https://api.weixin.qq.com/wxa/business/getuserencryptkey?access_token=ACCESS_TOKEN&openid=OPENID&signature=SIGNATURE&sig_method=hmac_sha256
* @param openid 用户的openid
* @param signature 用sessionkey对空字符串签名得到的结果
* @param sigMethod 签名方法,只支持 hmac_sha256
* </pre>
*
* @return {@link WxMaInternetResponse}
* @throws WxErrorException
*/
WxMaInternetResponse getUserEncryptKey(String openid, String signature, String sigMethod) throws WxErrorException;
/**
* <pre>
* 获取用户encryptKey。 会获取用户最近3次的key,每个key的存活时间为3600s。
* 文档地址:https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/internet/internet.getUserEncryptKey.html
* 接口地址:POST https://api.weixin.qq.com/wxa/business/getuserencryptkey?access_token=ACCESS_TOKEN&openid=OPENID&signature=SIGNATURE&sig_method=hmac_sha256
* @param openid 用户的openid
* @param sessionKey 用户的sessionKey
* </pre>
*
* @return {@link WxMaInternetResponse}
* @throws WxErrorException
*/
WxMaInternetResponse getUserEncryptKey(String openid, String sessionKey) throws WxErrorException;
}