diff --git a/mallinkService/src/main/java/com/iformall/service/toutiao/api/TtOpenMaService.java b/mallinkService/src/main/java/com/iformall/service/toutiao/api/TtOpenMaService.java index a3cbe02..184b002 100644 --- a/mallinkService/src/main/java/com/iformall/service/toutiao/api/TtOpenMaService.java +++ b/mallinkService/src/main/java/com/iformall/service/toutiao/api/TtOpenMaService.java @@ -129,7 +129,7 @@ public interface TtOpenMaService extends TtMaService { /** * 5. 将第三方提交的代码包提交审核(仅供第三方开发者代小程序调用) */ - String API_SUBMIT_AUDIT = "https://api.weixin.qq.com/wxa/submit_audit"; + String API_SUBMIT_AUDIT = "https://open.microapp.bytedance.com/openapi/v2/microapp/package/audit"; /** * 7. 查询某个指定版本的审核状态(仅供第三方代小程序调用) @@ -144,7 +144,7 @@ public interface TtOpenMaService extends TtMaService { /** * 9. 发布已通过审核的小程序(仅供第三方代小程序调用) */ - String API_RELEASE = "https://api.weixin.qq.com/wxa/release"; + String API_RELEASE = "https://open.microapp.bytedance.com/openapi/v1/microapp/package/release"; /** * 10. 修改小程序线上代码的可见状态(仅供第三方代小程序调用) @@ -371,7 +371,7 @@ public interface TtOpenMaService extends TtMaService { /** * 将第三方提交的代码包提交审核(仅供第三方开发者代小程序调用) */ - WxOpenMaSubmitAuditResult submitAudit(WxOpenMaSubmitAuditMessage submitAuditMessage) throws WxErrorException; + TtOpenResult submitAudit() throws WxErrorException; /** * 查询某个指定版本的审核状态(仅供第三方代小程序调用) @@ -386,7 +386,7 @@ public interface TtOpenMaService extends TtMaService { /** * 发布已通过审核的小程序(仅供第三方代小程序调用). */ - WxOpenResult releaesAudited() throws WxErrorException; + TtOpenResult releaesAudited() throws WxErrorException; /** * 10. 修改小程序线上代码的可见状态(仅供第三方代小程序调用) diff --git a/mallinkService/src/main/java/com/iformall/service/toutiao/api/bean/TtOpenNotifyMsg.java b/mallinkService/src/main/java/com/iformall/service/toutiao/api/bean/TtOpenNotifyMsg.java index 36018f2..e6b1e31 100644 --- a/mallinkService/src/main/java/com/iformall/service/toutiao/api/bean/TtOpenNotifyMsg.java +++ b/mallinkService/src/main/java/com/iformall/service/toutiao/api/bean/TtOpenNotifyMsg.java @@ -1,5 +1,6 @@ package com.iformall.service.toutiao.api.bean; +import com.google.gson.JsonArray; import lombok.*; import java.io.Serializable; @@ -29,6 +30,7 @@ public class TtOpenNotifyMsg implements Serializable { * AUTHORIZED ------ 授权通知 * UNAUTHORIZED ----- 解除授权通知 * UPDATE_AUTHORIZED ------- 找回授权码通知 + * PACKAGE_AUDIT ------审核结果通知 */ private String event; @@ -48,6 +50,8 @@ public class TtOpenNotifyMsg implements Serializable { private String authorizationCode;//授权码 private Integer authorizationCodeExpiresIn;//授权码有效期 + private JsonArray auditResults;//审核结果 + public static TtOpenNotifyMsg fromJson(String json) { return TtOpenGsonBuilder.create().fromJson(json, TtOpenNotifyMsg.class); diff --git a/mallinkService/src/main/java/com/iformall/service/toutiao/api/bean/TtOpenNotifyMsgGsonAdapter.java b/mallinkService/src/main/java/com/iformall/service/toutiao/api/bean/TtOpenNotifyMsgGsonAdapter.java index 1736694..8ad7f4d 100644 --- a/mallinkService/src/main/java/com/iformall/service/toutiao/api/bean/TtOpenNotifyMsgGsonAdapter.java +++ b/mallinkService/src/main/java/com/iformall/service/toutiao/api/bean/TtOpenNotifyMsgGsonAdapter.java @@ -30,6 +30,8 @@ public class TtOpenNotifyMsgGsonAdapter implements JsonDeserializer() {}.getType()); - logger.info(subMessage.toString()); TtOpenMaService openMaService = openService.getTtOpenComponentService().getTtMaServiceByAppid(codeStatus.getAppId()); - WxOpenMaSubmitAuditResult openRet = openMaService.submitAudit(subMessage); + TtOpenResult openRet = openMaService.submitAudit(); logger.info(openRet.toString()); if(openRet.isSuccess()) { submitStatus = true; - auditid = openRet.getAuditId(); } else { submitStatus = false; } @@ -880,7 +877,7 @@ public class WxWeappInfoController extends BaseController { try { TtOpenMaService openMaService = openService.getTtOpenComponentService().getTtMaServiceByAppid(auditStatus.getAppId()); - WxOpenResult openRet = openMaService.releaesAudited(); + TtOpenResult openRet = openMaService.releaesAudited(); logger.info(openRet.toString()); boolean releaseSuccess = false; if(openRet.isSuccess()) { @@ -889,11 +886,7 @@ public class WxWeappInfoController extends BaseController { if(releaseSuccess) { releaseStatus.setReleaseStatus(EnumWeappReleaseStatus.SUCCESS.getCode()); } else { - if(openRet.getErrcode().equals(OpenConstant.ERR_CODE_APP_IS_RELEASED)) { - releaseStatus.setReleaseStatus(EnumWeappReleaseStatus.SUCCESS.getCode()); - } else { - releaseStatus.setReleaseStatus(EnumWeappReleaseStatus.FAIL.getCode()); - } + releaseStatus.setReleaseStatus(EnumWeappReleaseStatus.FAIL.getCode()); } releaseStatus.setReleaseErrCode(gson.toJson(openRet)); releaseStatus.setReleaseTime(new Date());