From daf26a3a6b27f508d5e5765f00c028df99749ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=95=B5=E5=95=B5=E9=B8=A1?= Date: Thu, 1 Feb 2024 13:18:48 +0800 Subject: [PATCH 1/3] =?UTF-8?q?:new:=201.=20WxOpenMaService=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=8E=B7=E5=8F=96=E9=9A=90=E7=A7=81=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E7=BB=93=E6=9E=9C=E7=9A=84API=EF=BC=9B2.=20W?= =?UTF-8?q?xMpXmlMessage=20=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E9=80=9A=E7=9F=A5=E5=9B=9E=E8=B0=83=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0DelayTime-=E5=AE=A1=E6=A0=B8=E5=BB=B6=E5=90=8E?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E6=97=B6=E9=97=B4=E6=88=B3=EF=BC=8CScreenSho?= =?UTF-8?q?t-=E5=AE=A1=E6=A0=B8=E4=B8=8D=E9=80=9A=E8=BF=87=E7=9A=84?= =?UTF-8?q?=E6=88=AA=E5=9B=BE=E7=A4=BA=E4=BE=8B=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mp/bean/message/WxMpXmlMessage.java | 14 ++++++++ .../weixin/open/api/WxOpenMaService.java | 15 ++++++++ .../open/api/impl/WxOpenMaServiceImpl.java | 6 ++++ .../WxOpenMaGetCodePrivacyInfoResult.java | 34 +++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaGetCodePrivacyInfoResult.java diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java index 2c801f93e2..3a30c9f149 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java @@ -709,6 +709,20 @@ public class WxMpXmlMessage implements Serializable { @JacksonXmlProperty(localName = "Reason") private String reason; + /** + * 审核延后时的时间(整形),时间戳 + */ + @XStreamAlias("DelayTime") + @JacksonXmlProperty(localName = "DelayTime") + private Long delayTime; + + /** + * 审核不通过的截图示例。用 | 分隔的 media_id 的列表 + */ + @XStreamAlias("ScreenShot") + @JacksonXmlProperty(localName = "ScreenShot") + private String screenShot; + /////////////////////////////////////// // 扫一扫事件推送 /////////////////////////////////////// diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java index deb6098c3c..3ac8c03bee 100644 --- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java @@ -225,6 +225,11 @@ public interface WxOpenMaService extends WxMaService { */ String API_GET_GRAY_RELEASE_PLAN = "https://api.weixin.qq.com/wxa/getgrayreleaseplan"; + /** + * 17 获取隐私接口检测结果 + */ + String API_GET_CODE_PRIVACY_INFO = "https://api.weixin.qq.com/wxa/security/get_code_privacy_info"; + /** * 查询服务商的当月提审限额和加急次数(Quota) @@ -624,6 +629,16 @@ WxOpenMaDomainResult modifyDomain(String action, List requestDomains, Li */ WxOpenMaGrayReleasePlanResult getGrayReleasePlan() throws WxErrorException; + /** + * 17. 获取隐私接口检测结果 + * https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/code-management/getCodePrivacyInfo.html + * + * @return {@link WxOpenMaGetCodePrivacyInfoResult } + * @throws WxErrorException wx错误异常 + * @author Yuan + */ + WxOpenMaGetCodePrivacyInfoResult getCodePrivacyInfo() throws WxErrorException; + /** * 查询服务商的当月提审限额和加急次数(Quota) * https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/code/query_quota.html diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java index dac8cceefa..fd65601928 100644 --- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java @@ -346,6 +346,12 @@ public WxOpenMaGrayReleasePlanResult getGrayReleasePlan() throws WxErrorExceptio return WxMaGsonBuilder.create().fromJson(response, WxOpenMaGrayReleasePlanResult.class); } + @Override + public WxOpenMaGetCodePrivacyInfoResult getCodePrivacyInfo() throws WxErrorException { + String response = get(API_GET_CODE_PRIVACY_INFO, null); + return WxMaGsonBuilder.create().fromJson(response, WxOpenMaGetCodePrivacyInfoResult.class); + } + @Override public WxOpenMaQueryQuotaResult queryQuota() throws WxErrorException { String response = get(API_QUERY_QUOTA, null); diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaGetCodePrivacyInfoResult.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaGetCodePrivacyInfoResult.java new file mode 100644 index 0000000000..1eddd1f81f --- /dev/null +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaGetCodePrivacyInfoResult.java @@ -0,0 +1,34 @@ +package me.chanjar.weixin.open.bean.result; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 获取隐私接口检测返回结果 + * + * @author Yuan + * @version 1.0.0 + * @date 2024-02-01 12:49:58 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class WxOpenMaGetCodePrivacyInfoResult extends WxOpenResult { + + private static final long serialVersionUID = -2660090947103046607L; + + /** + * 没权限的隐私接口的api英文名 + */ + @SerializedName("without_auth_list") + private List withoutAuthList; + + /** + * 没配置的隐私接口的api英文名 + */ + @SerializedName("without_conf_list") + private List withoutConfList; + +} From 85adeeb0c4828975cc9a38ca552fce4658d74219 Mon Sep 17 00:00:00 2001 From: Aimkz Date: Wed, 4 Dec 2024 18:44:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?:new:=20[=E5=BE=AE=E4=BF=A1=E5=BC=80?= =?UTF-8?q?=E6=94=BE=E5=B9=B3=E5=8F=B0]-=E5=A2=9E=E5=8A=A0=E5=8D=8A?= =?UTF-8?q?=E5=B1=8F=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=AE=A1=E7=90=86=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../open/api/WxOpenMaEmbeddedService.java | 133 ++++++++++++++ .../weixin/open/api/WxOpenMaService.java | 9 + .../api/impl/WxOpenMaEmbeddedServiceImpl.java | 165 ++++++++++++++++++ .../open/api/impl/WxOpenMaServiceImpl.java | 3 + .../weixin/open/bean/ma/WxOpenMaEmbedded.java | 59 +++++++ .../result/WxOpenMaEmbeddedListResult.java | 39 +++++ 6 files changed, 408 insertions(+) create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaEmbeddedService.java create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaEmbeddedServiceImpl.java create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/ma/WxOpenMaEmbedded.java create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaEmbeddedListResult.java diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaEmbeddedService.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaEmbeddedService.java new file mode 100644 index 0000000000..80fdac2f38 --- /dev/null +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaEmbeddedService.java @@ -0,0 +1,133 @@ +package me.chanjar.weixin.open.api; + +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.open.bean.result.WxOpenMaEmbeddedListResult; + +/** + * 半屏小程序管理服务 + *
+ *   半屏小程序管理
+ * 
+ * + * @author Yuan + * @version 1.0.0 + * @date 2024-12-04 16:55:19 + */ +public interface WxOpenMaEmbeddedService { + + /** + * 添加半屏小程序 + *
+   *     本接口用于添加半屏小程序
+   * 
+ */ + String API_ADD_EMBEDDED = "https://api.weixin.qq.com/wxaapi/wxaembedded/add_embedded"; + + /** + * 删除半屏小程序 + *
+   *     用本接口可以删除已经获得授权调用的半屏小程序
+   *     说明:通过add_embedded接口添加半屏小程序后,可通过当前接口删除已经添加到半屏小程序列表的小程序
+   * 
+ */ + String API_DELETE_EMBEDDED = "https://api.weixin.qq.com/wxaapi/wxaembedded/del_embedded"; + + /** + * 获取半屏小程序调用列表 + *
+   *     调用本接口可以获取半屏小程序调用列表
+   *     说明:通过addEmbedded接口添加半屏小程序后,可通过当前接口获取半屏小程序调用列表
+   * 
+ */ + String API_GET_EMBEDDED_LIST = "https://api.weixin.qq.com/wxaapi/wxaembedded/get_list"; + + /** + * 取消授权小程序 + *
+   *     调用本接口可以取消已经授权的小程序
+   *     说明:可通过get_own_list接口获取当前半屏小程序已经授权的小程序列表,可通过当前接口取消对某个小程序的调用权限
+   * 
+ */ + String API_DELETE_AUTHORIZED_EMBEDDED = "https://api.weixin.qq.com/wxaapi/wxaembedded/del_authorize"; + + /** + * 获取半屏小程序授权列表 + *
+   *     调用本接口可以获取半屏小程序授权列表
+   *     说明:一个半屏小程序可授权给1000个小程序调用,通过该接口可获取已经授权的小程序列表
+   * 
+ */ + String API_GET_OWN_LIST = "https://api.weixin.qq.com/wxaapi/wxaembedded/get_own_list"; + + /** + * 设置授权方式 + */ + String API_SET_AUTHORIZED_EMBEDDED = "https://api.weixin.qq.com/wxaapi/wxaembedded/set_authorize"; + + /** + * 添加半屏小程序 + * + * @param embeddedAppId 半屏小程序appId + * @param applyReason 申请理由 + * @author Yuan + * @date 2024-12-04 17:33:33 + */ + void addEmbedded(String embeddedAppId, String applyReason) throws WxErrorException; + + /** + * 删除半屏小程序 + * + * @param embeddedAppId 半屏小程序appId + * @author Yuan + * @date 2024-12-04 17:33:33 + */ + void deleteEmbedded(String embeddedAppId) throws WxErrorException; + + /** + * 获取半屏小程序调用列表 + * + * @return {@link WxOpenMaEmbeddedListResult } + * @author Yuan + * @date 2024-12-04 17:33:33 + */ + WxOpenMaEmbeddedListResult getEmbeddedList() throws WxErrorException; + + /** + * 取消授权小程序 + * + * @param embeddedAppId 半屏小程序appId + * @author Yuan + * @date 2024-12-04 17:33:33 + */ + void deleteAuthorizedEmbedded(String embeddedAppId) throws WxErrorException; + + /** + * 获取半屏小程序授权列表,默认分页起始值为0,一次拉取最大值为1000 + * + * @return {@link WxOpenMaEmbeddedListResult } + * @author Yuan + * @date 2024-12-04 17:33:33 + */ + WxOpenMaEmbeddedListResult getOwnList() throws WxErrorException; + + /** + * 获取半屏小程序授权列表 + * + * @param start 分页起始值 ,默认值为0 + * @param num 一次拉取最大值,最大 1000,默认值为10 + * @return {@link WxOpenMaEmbeddedListResult } + * @author Yuan + * @date 2024-12-04 17:33:33 + */ + WxOpenMaEmbeddedListResult getOwnList(Integer start, Integer num) throws WxErrorException; + + /** + * 设置授权方式 + * + * @param flag 半屏小程序授权方式。0表示需要管理员验证;1表示自动通过;2表示自动拒绝。 + * @author Yuan + * @date 2024-12-04 17:33:33 + */ + void setAuthorizedEmbedded(Integer flag) throws WxErrorException; + +} diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java index 6d540940c0..7a3bbca44a 100644 --- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java @@ -738,6 +738,15 @@ WxOpenMaDomainResult modifyDomain(String action, List requestDomains, Li */ WxOpenMaPrivacyService getPrivacyService(); + /** + * 半屏小程序服务 + * + * @return {@link WxOpenMaEmbeddedService } + * @author Yuan + * @date 2024-12-04 18:42:21 + */ + WxOpenMaEmbeddedService getEmbeddedService(); + /** * 购物订单 * diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaEmbeddedServiceImpl.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaEmbeddedServiceImpl.java new file mode 100644 index 0000000000..8a4a171af7 --- /dev/null +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaEmbeddedServiceImpl.java @@ -0,0 +1,165 @@ +package me.chanjar.weixin.open.api.impl; + +import cn.binarywang.wx.miniapp.api.WxMaService; +import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder; +import com.google.gson.JsonObject; +import lombok.AllArgsConstructor; +import me.chanjar.weixin.common.enums.WxType; +import me.chanjar.weixin.common.error.WxError; +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.open.api.WxOpenMaEmbeddedService; +import me.chanjar.weixin.open.bean.result.WxOpenMaEmbeddedListResult; +import org.apache.commons.lang3.StringUtils; + +/** + * 半屏小程序管理服务 + *
+ *   半屏小程序管理
+ * 
+ * + * @author Yuan + * @version 1.0.0 + * @date 2024-12-04 16:55:19 + */ +@AllArgsConstructor +public class WxOpenMaEmbeddedServiceImpl implements WxOpenMaEmbeddedService { + + private final WxMaService wxMaService; + + /** + * 添加半屏小程序 + * + * @param embeddedAppId 半屏小程序appId + * @param applyReason 申请理由 + * @author Yuan + * @date 2024-12-04 17:33:33 + */ + @Override + public void addEmbedded(String embeddedAppId, String applyReason) throws WxErrorException { + JsonObject params = new JsonObject(); + params.addProperty("appid", embeddedAppId); + if (StringUtils.isNotBlank(applyReason)) { + params.addProperty("apply_reason", applyReason); + } + String response = wxMaService.post(API_ADD_EMBEDDED, params); + WxError wxError = WxError.fromJson(response, WxType.MiniApp); + if (wxError.getErrorCode() != 0) { + throw new WxErrorException(wxError); + } + } + + /** + * 删除半屏小程序 + * + * @param embeddedAppId 半屏小程序appId + * @author Yuan + * @date 2024-12-04 17:33:33 + */ + @Override + public void deleteEmbedded(String embeddedAppId) throws WxErrorException { + JsonObject params = new JsonObject(); + params.addProperty("appid", embeddedAppId); + String response = wxMaService.post(API_DELETE_EMBEDDED, params); + WxError wxError = WxError.fromJson(response, WxType.MiniApp); + if (wxError.getErrorCode() != 0) { + throw new WxErrorException(wxError); + } + } + + /** + * 获取半屏小程序调用列表 + * + * @author Yuan + * @date 2024-12-04 17:33:33 + */ + @Override + public WxOpenMaEmbeddedListResult getEmbeddedList() throws WxErrorException { + String response = wxMaService.get(API_GET_EMBEDDED_LIST, null); + WxError wxError = WxError.fromJson(response, WxType.MiniApp); + if (wxError.getErrorCode() != 0) { + throw new WxErrorException(wxError); + } + return WxMaGsonBuilder.create().fromJson(response, WxOpenMaEmbeddedListResult.class); + } + + /** + * 取消授权小程序 + * + * @param embeddedAppId 半屏小程序appId + * @author Yuan + * @date 2024-12-04 17:33:33 + */ + @Override + public void deleteAuthorizedEmbedded(String embeddedAppId) throws WxErrorException { + JsonObject params = new JsonObject(); + params.addProperty("appid", embeddedAppId); + String response = wxMaService.post(API_DELETE_AUTHORIZED_EMBEDDED, params); + WxError wxError = WxError.fromJson(response, WxType.MiniApp); + if (wxError.getErrorCode() != 0) { + throw new WxErrorException(wxError); + } + } + + /** + * 获取半屏小程序授权列表 + * + * @return {@link WxOpenMaEmbeddedListResult } + * @author Yuan + * @date 2024-12-04 17:33:33 + */ + @Override + public WxOpenMaEmbeddedListResult getOwnList() throws WxErrorException { + String response = wxMaService.get(API_GET_OWN_LIST + "?num=1000", null); + WxError wxError = WxError.fromJson(response, WxType.MiniApp); + if (wxError.getErrorCode() != 0) { + throw new WxErrorException(wxError); + } + return WxMaGsonBuilder.create().fromJson(response, WxOpenMaEmbeddedListResult.class); + } + + /** + * 获取半屏小程序授权列表 + * + * @param start 分页起始值 ,默认值为0 + * @param num 一次拉取最大值,最大 1000,默认值为10 + * @return {@link WxOpenMaEmbeddedListResult } + * @author Yuan + * @date 2024-12-04 17:33:33 + */ + @Override + public WxOpenMaEmbeddedListResult getOwnList(Integer start, Integer num) throws WxErrorException { + if (null == start) { + start = 0; + } + if (null == num) { + num = 10; + } + if (num > 1000) { + num = 1000; + } + String response = wxMaService.get(API_GET_OWN_LIST + "?start=" + start + "&num=" + num, null); + WxError wxError = WxError.fromJson(response, WxType.MiniApp); + if (wxError.getErrorCode() != 0) { + throw new WxErrorException(wxError); + } + return WxMaGsonBuilder.create().fromJson(response, WxOpenMaEmbeddedListResult.class); + } + + /** + * 设置授权方式 + * + * @param flag 半屏小程序授权方式。0表示需要管理员验证;1表示自动通过;2表示自动拒绝。 + * @author Yuan + * @date 2024-12-04 17:33:33 + */ + @Override + public void setAuthorizedEmbedded(Integer flag) throws WxErrorException { + JsonObject params = new JsonObject(); + params.addProperty("flag", flag); + String response = wxMaService.post(API_SET_AUTHORIZED_EMBEDDED, params); + WxError wxError = WxError.fromJson(response, WxType.MiniApp); + if (wxError.getErrorCode() != 0) { + throw new WxErrorException(wxError); + } + } +} diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java index 75be6bd4e1..08bfc92bf7 100644 --- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java @@ -54,6 +54,8 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ private final WxOpenMaPrivacyService privacyService; @Getter private final WxOpenMaShoppingOrdersService shoppingOrdersService; + @Getter + private final WxOpenMaEmbeddedService embeddedService; public WxOpenMaServiceImpl(WxOpenComponentService wxOpenComponentService, String appId, WxMaConfig wxMaConfig) { this.wxOpenComponentService = wxOpenComponentService; @@ -64,6 +66,7 @@ public WxOpenMaServiceImpl(WxOpenComponentService wxOpenComponentService, String this.icpService = new WxOpenMaIcpServiceImpl(this); this.privacyService = new WxOpenMaPrivacyServiceImpl(this); this.shoppingOrdersService = new WxOpenMaShoppingOrdersServiceImpl(this); + this.embeddedService = new WxOpenMaEmbeddedServiceImpl(this); initHttp(); } diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/ma/WxOpenMaEmbedded.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/ma/WxOpenMaEmbedded.java new file mode 100644 index 0000000000..e408b3baf4 --- /dev/null +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/ma/WxOpenMaEmbedded.java @@ -0,0 +1,59 @@ +package me.chanjar.weixin.open.bean.ma; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import me.chanjar.weixin.open.util.json.WxOpenGsonBuilder; + +import java.io.Serializable; + +/** + * 微信开放平台半屏小程序信息 + * + * @author Yuan + * @version 1.0.0 + * @date 2024-12-04 17:57:40 + */ +@Data +public class WxOpenMaEmbedded implements Serializable { + private static final long serialVersionUID = -7319330493157204072L; + + /** + * 半屏小程序appid + */ + @SerializedName("appid") + private String appId; + /** + * 添加时间 + */ + @SerializedName("create_time") + private Long createTime; + /** + * 头像url + */ + @SerializedName("headimg") + private String headImg; + /** + * 半屏小程序昵称 + */ + @SerializedName("nickname") + private String nickName; + /** + * 申请理由 + */ + @SerializedName("reason") + private String reason; + /** + * 申请状态,1-待验证,2-已通过,3-已拒绝,4-已超时,5-已撤销,6-已取消授权 + */ + @SerializedName("status") + private String status; + + @Override + public String toString() { + return WxOpenGsonBuilder.create().toJson(this); + } + + public String toJson() { + return WxOpenGsonBuilder.create().toJson(this); + } +} diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaEmbeddedListResult.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaEmbeddedListResult.java new file mode 100644 index 0000000000..b4f9d4e882 --- /dev/null +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaEmbeddedListResult.java @@ -0,0 +1,39 @@ +package me.chanjar.weixin.open.bean.result; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import me.chanjar.weixin.open.bean.ma.WxOpenMaEmbedded; +import me.chanjar.weixin.open.util.json.WxOpenGsonBuilder; + +import java.util.List; + +/** + * 获取半屏小程序调用列表返回值 + * + * @author Yuan + * @version 1.0.0 + * @date 2024-12-04 18:06:40 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class WxOpenMaEmbeddedListResult extends WxOpenResult { + private static final long serialVersionUID = -6484320771244602727L; + + /** + * 半屏小程序列表 + */ + @SerializedName("wxa_embedded_list") + private List embeddedList; + + /** + * 授权方式,0表示需要管理员确认,1表示自动通过,2表示自动拒绝 + */ + @SerializedName("embedded_flag") + private Integer embeddedFlag; + + @Override + public String toString() { + return WxOpenGsonBuilder.create().toJson(this); + } +} From 1366a6c78e5de9e404256041e23518a200e330e1 Mon Sep 17 00:00:00 2001 From: Aimkz Date: Thu, 5 Dec 2024 10:41:55 +0800 Subject: [PATCH 3/3] =?UTF-8?q?:new:=20[=E5=BE=AE=E4=BF=A1=E5=BC=80?= =?UTF-8?q?=E6=94=BE=E5=B9=B3=E5=8F=B0]-=E5=A2=9E=E5=8A=A0=E5=8D=8A?= =?UTF-8?q?=E5=B1=8F=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=AE=A1=E7=90=86=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weixin/common/error/WxMaErrorMsgEnum.java | 126 ++++++++++++++++++ .../result/WxOpenMaEmbeddedListResult.java | 4 + 2 files changed, 130 insertions(+) diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxMaErrorMsgEnum.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxMaErrorMsgEnum.java index 46c1d3d3d2..1bb3f6472b 100644 --- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxMaErrorMsgEnum.java +++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxMaErrorMsgEnum.java @@ -711,6 +711,132 @@ public enum WxMaErrorMsgEnum { CODE_89255(89255, "code参数无效,请检查code长度以及内容是否正确_;注意code_type的值不同需要传的code长度不一样 ;注意code_type的值不同需要传的code长度不一样"), // CODE_504002(-504002, "云函数未找到 Function not found"), + + /** + * 半屏小程序系统错误 + */ + CODE_89408(89408, "半屏小程序系统错误"), + + /** + * 获取半屏小程序列表参数错误 + */ + CODE_89409(89409, "获取半屏小程序列表参数错误"), + + /** + * 添加半屏小程序appid参数错误 + */ + CODE_89410(89410, "添加半屏小程序appid参数错误"), + + /** + * 添加半屏小程序appid参数为空 + */ + CODE_89411(89411, "添加半屏小程序appid参数为空"), + + /** + * 添加半屏小程序申请理由不得超过30个字 + */ + CODE_89412(89412, "添加半屏小程序申请理由不得超过30个字"), + + /** + * 该小程序被申请次数已达24h限制 + */ + CODE_89413(89413, "该小程序被申请次数已达24h限制"), + + /** + * 每天仅允许申请50次半屏小程序 + */ + CODE_89414(89414, "每天仅允许申请50次半屏小程序"), + + /** + * 删除半屏小程序appid参数为空 + */ + CODE_89415(89415, "删除半屏小程序appid参数为空"), + + /** + * 取消半屏小程序授权appid参数为空 + */ + CODE_89416(89416, "取消半屏小程序授权appid参数为空"), + + /** + * 修改半屏小程序方式flag参数错误 + */ + CODE_89417(89417, "修改半屏小程序方式flag参数错误"), + + /** + * 获取半屏小程序每日申请次数失败 + */ + CODE_89418(89418, "获取半屏小程序每日申请次数失败"), + + /** + * 获取半屏小程序每日授权次数失败 + */ + CODE_89419(89419, "获取半屏小程序每日授权次数失败"), + + /** + * 不支持添加个人主体小程序 + */ + CODE_89420(89420, "不支持添加个人主体小程序"), + + /** + * 删除数据未找到 + */ + CODE_89421(89421, "删除数据未找到"), + + /** + * 删除状态异常 + */ + CODE_89422(89422, "删除状态异常"), + + /** + * 申请次数添加到达上限 + */ + CODE_89423(89423, "申请次数添加到达上限"), + + /** + * 申请添加已超时 + */ + CODE_89425(89425, "申请添加已超时"), + + /** + * 申请添加状态异常 + */ + CODE_89426(89426, "申请添加状态异常"), + + /** + * 申请号和授权号相同 + */ + CODE_89427(89427, "申请号和授权号相同"), + + /** + * 该小程序已申请,不允许重复添加 + */ + CODE_89428(89428, "该小程序已申请,不允许重复添加"), + + /** + * 已到达同一小程序每日最多申请次数 + */ + CODE_89429(89429, "已到达同一小程序每日最多申请次数"), + + /** + * 该小程序已设置自动拒绝申请 + */ + CODE_89430(89430, "该小程序已设置自动拒绝申请"), + + /** + * 不支持此类型小程序 + */ + CODE_89431(89431, "不支持此类型小程序"), + + /** + * 不是小程序 + */ + CODE_89432(89432, "不是小程序"), + + /** + * 授权次数到达上限 + */ + CODE_89424(89424, "授权次数到达上限"), + ; private final int code; diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaEmbeddedListResult.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaEmbeddedListResult.java index b4f9d4e882..258a2630fa 100644 --- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaEmbeddedListResult.java +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaEmbeddedListResult.java @@ -36,4 +36,8 @@ public class WxOpenMaEmbeddedListResult extends WxOpenResult { public String toString() { return WxOpenGsonBuilder.create().toJson(this); } + + public String toJson() { + return WxOpenGsonBuilder.create().toJson(this); + } }