🎨 #3627 【开放平台】小程序三方平台代上传代码提交额外信息对象新增requiredPrivateInfos信息

Co-authored-by: zhoushi1 <qiannanyou9@gmail.com>
This commit is contained in:
zhoushi1 2025-06-28 20:57:37 +08:00 committed by GitHub
parent ccbfa98864
commit 72266c3aeb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -94,6 +94,26 @@ public class WxMaOpenCommitExtInfo implements Serializable {
@SerializedName("tabBar") @SerializedName("tabBar")
private WxMaOpenTabBar tabBar; private WxMaOpenTabBar tabBar;
/**
* 关于新增 requiredPrivateInfos 说明
* 关于地理位置接口新增与相关流程调整可以查看社区公告
* <a href="https://developers.weixin.qq.com/community/develop/doc/000a02f2c5026891650e7f40351c01">点击查看</a>
* 7.14后在代码中使用的地理位置相关接口共计 8 见表1第三方开发者均需要在 ext_json 参数中 requiredPrivateInfos 配置项中声明
* 在ext_json参数中配置requiredPrivateInfos其规则为整体替换即如果在 app.json 里也配置了那么最终会是ext_json的配置会覆盖 app.json
* 配置的requiredPrivateInfos其余规则可查看下方的ext_json补充说明
* 在ext_json参数中配置 requiredPrivateInfos 示例如下
* {
* "template_id": "95",
* "ext_json": "{\"requiredPrivateInfos\":[\"onLocationChange\",\"startLocationUpdate\"]}",
* "user_version": "V1.0",
* "user_desc": "test"
* }
* requiredPrivateInfos主要会检查格式是否正确填入的 api 名称是否正确填入的 api 名称是否有权限填入的 api 名称是否互斥对应的错误码可查看文档末尾的错误码文档
* requiredPrivateInfos在2022.7.14后才会生效文档提前更新是为了方便开发者可以提前了解接口的参数变更规则提前进行调整
*/
@SerializedName("requiredPrivateInfos")
private String[] requiredPrivateInfos;
/** /**
* 添加扩展项 * 添加扩展项
* *
@ -101,10 +121,12 @@ public class WxMaOpenCommitExtInfo implements Serializable {
* @param value * @param value
*/ */
public void addExt(String key, String value) { public void addExt(String key, String value) {
if (extMap == null) if (extMap == null) {
extMap = new HashMap<>(); extMap = new HashMap<>();
if (StringUtils.isNoneBlank(key, value)) }
if (StringUtils.isNoneBlank(key, value)) {
extMap.put(key, value); extMap.put(key, value);
}
} }
/** /**
@ -114,10 +136,12 @@ public class WxMaOpenCommitExtInfo implements Serializable {
* @param page * @param page
*/ */
public void addExtPage(String pagePath, WxMaOpenPage page) { public void addExtPage(String pagePath, WxMaOpenPage page) {
if (extPages == null) if (extPages == null) {
extPages = new HashMap<>(); extPages = new HashMap<>();
if (StringUtils.isNotBlank(pagePath) && page != null) }
if (StringUtils.isNotBlank(pagePath) && page != null) {
extPages.put(pagePath, page); extPages.put(pagePath, page);
}
} }
/** /**
@ -126,10 +150,12 @@ public class WxMaOpenCommitExtInfo implements Serializable {
* @param pagePath * @param pagePath
*/ */
public void addPage(String pagePath) { public void addPage(String pagePath) {
if (pageList == null) if (pageList == null) {
pageList = new ArrayList<>(); pageList = new ArrayList<>();
if (StringUtils.isNotBlank(pagePath)) }
if (StringUtils.isNotBlank(pagePath)) {
pageList.add(pagePath); pageList.add(pagePath);
}
} }
public static WxMaOpenCommitExtInfo INSTANCE() { public static WxMaOpenCommitExtInfo INSTANCE() {