forked from binarywang/WxJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWxOpenMaPrivacyService.java
More file actions
97 lines (80 loc) · 4.19 KB
/
WxOpenMaPrivacyService.java
File metadata and controls
97 lines (80 loc) · 4.19 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package me.chanjar.weixin.open.api;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.open.bean.ma.privacy.*;
import org.jetbrains.annotations.Nullable;
/**
* 微信第三方平台 小程序用户隐私保护指引接口 / 申请隐私接口(从2022年4月18日开始,部分小程序前端 api 需申请后,方可使用。该接口用于获取“需申请并审核通过”后才可使用的接口列表。)
* https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/privacy_config/set_privacy_setting.html
* https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/apply_api/get_privacy_interface.html
*
* @author <a href="https://www.sacoc.cn">广州跨界</a>
*/
public interface WxOpenMaPrivacyService {
/**
* 1 设置小程序用户隐私保护指引
*/
String OPEN_SET_PRIVACY_SETTING = "https://api.weixin.qq.com/cgi-bin/component/setprivacysetting";
/**
* 2 查询小程序用户隐私保护指引
*/
String OPEN_GET_PRIVACY_SETTING = "https://api.weixin.qq.com/cgi-bin/component/getprivacysetting";
/**
* 3 上传小程序用户隐私保护指引文件
*/
String OPEN_UPLOAD_PRIVACY_FILE = "https://api.weixin.qq.com/cgi-bin/component/uploadprivacyextfile";
/**
* 4 获取接口列表 从2022年4月18日开始,部分小程序前端 api 需申请后
*/
String GET_PRIVATE_INTERFACE = "https://api.weixin.qq.com/wxa/security/get_privacy_interface";
/**
* 5 申请接口 从2022年4月18日开始,部分小程序前端 api 需申请后
*/
String APPLY_PRIVATE_INTERFACE = "https://api.weixin.qq.com/wxa/security/apply_privacy_interface";
/**
* 查询小程序用户隐私保护指引
* 文档地址:https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/privacy_config/get_privacy_setting.html
*
* @param privacyVer 1表示现网版本,即,传1则该接口返回的内容是现网版本的;2表示开发版,即,传2则该接口返回的内容是开发版本的。默认是2。
* @return 查询结果
* @throws WxErrorException 如果出错,抛出此异常
*/
GetPrivacySettingResult getPrivacySetting(@Nullable Integer privacyVer) throws WxErrorException;
/**
* 设置小程序用户隐私保护指引
* 文档地址:https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/privacy_config/set_privacy_setting.html
*
* @param dto 参数对象
* @throws WxErrorException 如果出错,抛出此异常
*/
void setPrivacySetting(SetPrivacySetting dto) throws WxErrorException;
/**
* 上传小程序用户隐私保护指引文件
* 本接口用于上传自定义的小程序的用户隐私保护指引
* 仅限文本文件, 限制文件大小为不超过100kb,否则会报错
* 文档地址:https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/privacy_config/upload_privacy_exfile.html
*
* @param content 文本文件内容
* @return 上传结果
* @throws WxErrorException 如果出错,抛出此异常
*/
UploadPrivacyFileResult uploadPrivacyFile(String content) throws WxErrorException;
/**
* 隐私接口-获取接口列表
* 从2022年4月18日开始,部分小程序前端 api 需申请后,方可使用。该接口用于获取“需申请并审核通过”后才可使用的接口列表。
* 文档地址:https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/apply_api/get_privacy_interface.html
*
* @return 获取结果
* @throws WxErrorException 如果出错,抛出此异常
*/
GetPrivacyInterfaceResult getPrivacyInterface() throws WxErrorException;
/**
* 隐私接口-申请接口
* 从2022年4月18日开始,部分小程序前端 api 需申请后,方可使用。该接口用于获取“需申请并审核通过”后才可使用的接口列表。
* 文档地址:https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/apply_api/get_privacy_interface.html
*
* @param dto 请求参数
* @return 获取结果
* @throws WxErrorException 如果出错,抛出此异常
*/
ApplyPrivacyInterfaceResult applyPrivacyInterface(ApplyPrivacyInterface dto) throws WxErrorException;
}