🎨 #3040 【开放平台】小程序管理部分接口返回结果类增加参数,同时增加新的接口 (查询小程序线上代码的可见状态,获取小程序业务域名校验文件)

This commit is contained in:
vostro2013 2023-06-08 12:36:33 +08:00 committed by GitHub
parent 93f85f76d4
commit a357d794b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 148 additions and 9 deletions

View File

@ -42,6 +42,11 @@ public interface WxOpenMaService extends WxMaService {
*/
String API_SET_WEBVIEW_DOMAIN = "https://api.weixin.qq.com/wxa/setwebviewdomain";
/**
* 获取业务域名校验文件仅供第三方代小程序调用
*/
String API_GET_WEBVIEW_DOMAIN_CONFIRM_FILE = "https://api.weixin.qq.com/wxa/get_webviewdomain_confirmfile";
/**
* 获取帐号基本信息
* <pre>
@ -138,10 +143,15 @@ public interface WxOpenMaService extends WxMaService {
String API_RELEASE = "https://api.weixin.qq.com/wxa/release";
/**
* 10. 修改小程序线上代码的可见状态仅供第三方代小程序调用)
* 10.1 修改小程序线上代码的可见状态仅供第三方代小程序调用)
*/
String API_CHANGE_VISITSTATUS = "https://api.weixin.qq.com/wxa/change_visitstatus";
/**
* 10.2 查询小程序线上代码的可见状态仅供第三方代小程序调用)
*/
String API_GET_VISITSTATUS = "https://api.weixin.qq.com/wxa/getvisitstatus";
/**
* 11.小程序版本回退仅供第三方代小程序调用
*/
@ -315,6 +325,14 @@ public interface WxOpenMaService extends WxMaService {
*/
WxOpenMaWebDomainResult setWebViewDomainInfo(String action, List<String> domainList) throws WxErrorException;
/**
* 获取业务域名校验文件
*
* @return 业务域名校验文件信息
* @throws WxErrorException 操作失败时抛出具体错误码请看文档
*/
WxOpenMaDomainConfirmFileResult getWebviewDomainConfirmFile() throws WxErrorException;
/**
* 获取小程序的信息
*
@ -477,7 +495,7 @@ public interface WxOpenMaService extends WxMaService {
WxOpenResult releaseAudited() throws WxErrorException;
/**
* 10. 修改小程序线上代码的可见状态仅供第三方代小程序调用
* 10.1 修改小程序线上代码的可见状态仅供第三方代小程序调用
*
* @param action the action
* @return the wx open result
@ -485,6 +503,14 @@ public interface WxOpenMaService extends WxMaService {
*/
WxOpenResult changeVisitStatus(String action) throws WxErrorException;
/**
* 10.2 查询小程序服务状态仅供第三方代小程序调用
*
* @return 小程序服务状态
* @throws WxErrorException 查询失败时返回具体错误码请看此接口的注释文档
*/
WxOpenMaVisitStatusResult getVisitStatus() throws WxErrorException;
/**
* 11. 小程序版本回退仅供第三方代小程序调用
*

View File

@ -120,6 +120,11 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
return WxMaGsonBuilder.create().fromJson(response, WxOpenMaWebDomainResult.class);
}
@Override
public WxOpenMaDomainConfirmFileResult getWebviewDomainConfirmFile() throws WxErrorException {
String responseContent = post(API_GET_WEBVIEW_DOMAIN_CONFIRM_FILE, "{}");
return WxOpenMaDomainConfirmFileResult.fromJson(responseContent);
}
@Override
public String getAccountBasicInfo() throws WxErrorException {
@ -255,6 +260,12 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class);
}
@Override
public WxOpenMaVisitStatusResult getVisitStatus() throws WxErrorException {
String responseContent = post(API_GET_VISITSTATUS, "{}");
return WxOpenMaVisitStatusResult.fromJson(responseContent);
}
@Override
public WxOpenResult revertCodeRelease() throws WxErrorException {
String response = get(API_REVERT_CODE_RELEASE, null);

View File

@ -0,0 +1,32 @@
package me.chanjar.weixin.open.bean.result;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
/**
* 业务域名校验文件
*
* @author <a href="https://github.com/vostro2013">vostro2013</a>
* @date 2023/06/06
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class WxOpenMaDomainConfirmFileResult extends WxOpenResult {
/**
* 文件名
*/
@SerializedName("file_name")
private String fileName;
/**
* 文件内容
*/
@SerializedName("file_content")
private String fileContent;
public static WxOpenMaDomainConfirmFileResult fromJson(String json) {
return WxGsonBuilder.create().fromJson(json, WxOpenMaDomainConfirmFileResult.class);
}
}

View File

@ -3,6 +3,7 @@ package me.chanjar.weixin.open.bean.result;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.util.List;
@ -17,16 +18,49 @@ import java.util.List;
public class WxOpenMaDomainResult extends WxOpenResult {
private static final long serialVersionUID = 3406315629639573330L;
/**
* request合法域名
*/
@SerializedName("requestdomain")
List<String> requestdomainList;
private List<String> requestDomain;
/**
* socket合法域名
*/
@SerializedName("wsrequestdomain")
List<String> wsrequestdomainList;
private List<String> wsRequestDomain;
/**
* uploadFile合法域名
*/
@SerializedName("uploaddomain")
List<String> uploaddomainList;
private List<String> uploadDomain;
/**
* downloadFile合法域名
*/
@SerializedName("downloaddomain")
List<String> downloaddomainList;
private List<String> downloadDomain;
/**
* request不合法域名
*/
@SerializedName("invalid_requestdomain")
private List<String> invalidRequestDomain;
/**
* socket不合法域名
*/
@SerializedName("invalid_wsrequestdomain")
private List<String> invalidWsRequestDomain;
/**
* uploadFile不合法域名
*/
@SerializedName("invalid_uploaddomain")
private List<String> invalidUploadDomain;
/**
* downloadFile不合法域名
*/
@SerializedName("invalid_downloaddomain")
private List<String> invalidDownloadDomain;
public static WxOpenMaDomainResult fromJson(String json) {
return WxGsonBuilder.create().fromJson(json, WxOpenMaDomainResult.class);
}
}

View File

@ -35,4 +35,19 @@ public class WxOpenMaQueryAuditResult extends WxOpenResult {
*/
@SerializedName(value = "screenshot")
private String screenShot;
/**
* 审核版本
*/
@SerializedName("user_version")
private String userVersion;
/**
* 版本描述
*/
@SerializedName("user_desc")
private String userDesc;
/**
* 时间戳提交审核的时间
*/
@SerializedName("submit_audit_time")
private Long submitAuditTime;
}

View File

@ -0,0 +1,21 @@
package me.chanjar.weixin.open.bean.result;
import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 小程序服务状态
*
* @author <a href="https://github.com/vostro2013">vostro2013</a>
* @date 2023/06/06
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class WxOpenMaVisitStatusResult extends WxOpenResult {
private Integer status;
public static WxOpenMaVisitStatusResult fromJson(String json) {
return WxMaGsonBuilder.create().fromJson(json, WxOpenMaVisitStatusResult.class);
}
}