🆕 #2588 【小程序】代码管理增加查询小程序版本信息的接口

This commit is contained in:
Leon
2022-04-14 14:32:58 +08:00
committed by GitHub
parent a88619a7dc
commit f3921c7332
5 changed files with 123 additions and 15 deletions

View File

@@ -105,6 +105,14 @@ public interface WxMaCodeService {
*/
WxMaCodeVersionDistribution getSupportVersion() throws WxErrorException;
/**
* 查询小程序版本信息
*
* @return 小程序的体验版和线上版本信息
* @throws WxErrorException 失败时抛出,具体错误码请看此接口的注释文档
*/
WxMaCodeVersionInfo getVersionInfo() throws WxErrorException;
/**
* 设置最低基础库版本(仅供第三方代小程序调用).
*

View File

@@ -138,6 +138,12 @@ public class WxMaCodeServiceImpl implements WxMaCodeService {
return WxMaCodeVersionDistribution.fromJson(responseContent);
}
@Override
public WxMaCodeVersionInfo getVersionInfo() throws WxErrorException {
String responseContent = this.service.post(GET_VERSION_INFO_URL, "{}");
return WxMaCodeVersionInfo.fromJson(responseContent);
}
@Override
public void setSupportVersion(String version) throws WxErrorException {
JsonObject param = new JsonObject();