|
@@ -0,0 +1,52 @@
|
|
|
|
|
+package com.mrxu.framework.common.xcx.api;
|
|
|
|
|
+
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.mrxu.framework.common.weixin.base.WxHttp;
|
|
|
|
|
+import com.mrxu.framework.common.weixin.base.WxResult;
|
|
|
|
|
+import com.mrxu.framework.common.xcx.bean.InterfaceList;
|
|
|
|
|
+
|
|
|
|
|
+// 隐私接口
|
|
|
|
|
+public class PrivacyInterfaceApi {
|
|
|
|
|
+
|
|
|
|
|
+ // 获取接口状态
|
|
|
|
|
+ private static final String get_privacy_interface = "https://api.weixin.qq.com/wxa/security/get_privacy_interface?access_token=";
|
|
|
|
|
+
|
|
|
|
|
+ // 申请接口
|
|
|
|
|
+ private static final String apply_privacy_interface = "https://api.weixin.qq.com/wxa/security/apply_privacy_interface?access_token=";
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/apply_api/get_privacy_interface.html
|
|
|
|
|
+ * 获取接口列表
|
|
|
|
|
+ */
|
|
|
|
|
+ public static InterfaceList get(String accessToken) {
|
|
|
|
|
+ InterfaceList rs = WxHttp.get(InterfaceList.class,get_privacy_interface+accessToken,null);
|
|
|
|
|
+ return rs;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/apply_api/apply_privacy_interface.html
|
|
|
|
|
+ * 申请接口
|
|
|
|
|
+ * access_token string 是 第三方平台接口调用令牌authorizer_access_token
|
|
|
|
|
+ * api_name string 是 申请的 api 英文名,例如wx.choosePoi,严格区分大小写
|
|
|
|
|
+ * content string 是 申请说原因,不超过300个字符;需要以utf-8编码提交,否则会出现审核失败
|
|
|
|
|
+ * url_list string array 否 (辅助网页)例如,上传官网网页链接用于辅助审核
|
|
|
|
|
+ * pic_list string array 否 (辅助图片)填写图片的url ,最多10个
|
|
|
|
|
+ * video_list string array 否 (辅助视频)填写视频的链接 ,最多支持1个;视频格式只支持mp4格式
|
|
|
|
|
+ */
|
|
|
|
|
+ public static WxResult apply(String accessToken,
|
|
|
|
|
+ String api_name,
|
|
|
|
|
+ String content,
|
|
|
|
|
+ String [] url_list,
|
|
|
|
|
+ String [] pic_list,
|
|
|
|
|
+ String [] video_list) {
|
|
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
|
|
+ json.put("api_name", api_name);
|
|
|
|
|
+ json.put("content", content);
|
|
|
|
|
+ json.put("url_list", url_list);
|
|
|
|
|
+ json.put("pic_list", pic_list);
|
|
|
|
|
+ json.put("video_list", video_list);
|
|
|
|
|
+ WxResult rs = WxHttp.post(WxResult.class,apply_privacy_interface+accessToken,json);
|
|
|
|
|
+ return rs;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|