🆕 #2752 【小程序】增加查询小程序版本信息的接口以及第三方userid_to_openuserid的接口

This commit is contained in:
gxh0797
2022-07-26 21:47:39 +08:00
committed by GitHub
parent 1747190674
commit d056cc8abe
7 changed files with 128 additions and 0 deletions

View File

@ -251,6 +251,11 @@ public interface WxOpenMaService extends WxMaService {
*/
String API_WX_AMP_LINK_UN = "https://api.weixin.qq.com/cgi-bin/wxopen/wxampunlink";
/**
* 小程序管理-查询小程序版本信息
*/
String API_GET_VERSION_INFO = "https://api.weixin.qq.com/wxa/getversioninfo";
/**
* 获得小程序的域名配置信息
*
@ -702,4 +707,12 @@ public interface WxOpenMaService extends WxMaService {
*/
WxOpenResult wxAmpUnLink(String appid) throws WxErrorException;
/**
* 查询小程序版本信息
*
* @return the wx open result
* @throws WxErrorException the wx error exception
*/
WxOpenResult getVersionInfo() throws WxErrorException;
}

View File

@ -439,4 +439,12 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
}
return jsonArray;
}
@Override
public WxOpenResult getVersionInfo() throws WxErrorException {
JsonObject params = new JsonObject();
String response = post(API_GET_VERSION_INFO, GSON.toJson(params));
WxOpenResult result = WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class);
return result;
}
}