mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-10-31 10:38:42 +08:00 
			
		
		
		
	🆕 #2163 【开放平台】增加查询小程序可回退版本的接口
This commit is contained in:
		| @ -148,7 +148,9 @@ public interface WxOpenComponentService { | |||||||
|    * |    * | ||||||
|    * @param appid . |    * @param appid . | ||||||
|    * @return . wx fast ma service by appid |    * @return . wx fast ma service by appid | ||||||
|  |    * @deprecated 2021-06-23 本接口原有方法并非仅快速创建小程序的专用接口,普通小程序授权到第三方平台皆可使用,所以请使用 {@link WxOpenMaBasicService} 类替代。获取方法: WxOpenMaService.getBasicService() | ||||||
|    */ |    */ | ||||||
|  |   @Deprecated | ||||||
|   WxOpenFastMaService getWxFastMaServiceByAppid(String appid); |   WxOpenFastMaService getWxFastMaServiceByAppid(String appid); | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|  | |||||||
| @ -1,11 +1,6 @@ | |||||||
| package me.chanjar.weixin.open.api; | package me.chanjar.weixin.open.api; | ||||||
|  |  | ||||||
| import cn.binarywang.wx.miniapp.api.WxMaService; | import cn.binarywang.wx.miniapp.api.WxMaService; | ||||||
| import me.chanjar.weixin.common.error.WxErrorException; |  | ||||||
| import me.chanjar.weixin.open.bean.ma.WxFastMaCategory; |  | ||||||
| import me.chanjar.weixin.open.bean.result.*; |  | ||||||
|  |  | ||||||
| import java.util.List; |  | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * <pre> |  * <pre> | ||||||
| @ -16,189 +11,9 @@ import java.util.List; | |||||||
|  * |  * | ||||||
|  * @author Hipple |  * @author Hipple | ||||||
|  * @date 2019/01/23 |  * @date 2019/01/23 | ||||||
|  |  * @deprecated 2021-06-23 本接口原有方法并非仅快速创建小程序的专用接口,普通小程序授权到第三方平台皆可使用,所以请使用 {@link WxOpenMaBasicService} 类替代。获取方法: WxOpenComponentService.getWxMaServiceByAppid(maApppId).getBasicService() | ||||||
|  */ |  */ | ||||||
| public interface WxOpenFastMaService extends WxMaService { | @Deprecated | ||||||
|   /** | public interface WxOpenFastMaService extends WxOpenMaBasicService, WxMaService { | ||||||
|    * 1 获取帐号基本信息. |  | ||||||
|    */ |  | ||||||
|   String OPEN_GET_ACCOUNT_BASIC_INFO = "https://api.weixin.qq.com/cgi-bin/account/getaccountbasicinfo"; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 2 小程序名称设置及改名. |  | ||||||
|    */ |  | ||||||
|   String OPEN_SET_NICKNAME = "https://api.weixin.qq.com/wxa/setnickname"; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 3 小程序改名审核状态查询. |  | ||||||
|    */ |  | ||||||
|   String OPEN_API_WXA_QUERYNICKNAME = "https://api.weixin.qq.com/wxa/api_wxa_querynickname"; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 4 微信认证名称检测. |  | ||||||
|    */ |  | ||||||
|   String OPEN_CHECK_WX_VERIFY_NICKNAME = "https://api.weixin.qq.com/cgi-bin/wxverify/checkwxverifynickname"; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 5 修改头像. |  | ||||||
|    */ |  | ||||||
|   String OPEN_MODIFY_HEADIMAGE = "https://api.weixin.qq.com/cgi-bin/account/modifyheadimage"; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 6修改功能介绍. |  | ||||||
|    */ |  | ||||||
|   String OPEN_MODIFY_SIGNATURE = "https://api.weixin.qq.com/cgi-bin/account/modifysignature"; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 7 换绑小程序管理员接口. |  | ||||||
|    */ |  | ||||||
|   String OPEN_COMPONENT_REBIND_ADMIN = "https://api.weixin.qq.com/cgi-bin/account/componentrebindadmin"; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 8.1 获取账号可以设置的所有类目 |  | ||||||
|    */ |  | ||||||
|   String OPEN_GET_ALL_CATEGORIES = "https://api.weixin.qq.com/cgi-bin/wxopen/getallcategories"; |  | ||||||
|   /** |  | ||||||
|    * 8.2 添加类目 |  | ||||||
|    */ |  | ||||||
|   String OPEN_ADD_CATEGORY = "https://api.weixin.qq.com/cgi-bin/wxopen/addcategory"; |  | ||||||
|   /** |  | ||||||
|    * 8.3 删除类目 |  | ||||||
|    */ |  | ||||||
|   String OPEN_DELETE_CATEGORY = "https://api.weixin.qq.com/cgi-bin/wxopen/deletecategory"; |  | ||||||
|   /** |  | ||||||
|    * 8.4 获取账号已经设置的所有类目 |  | ||||||
|    */ |  | ||||||
|   String OPEN_GET_CATEGORY = "https://api.weixin.qq.com/cgi-bin/wxopen/getcategory"; |  | ||||||
|   /** |  | ||||||
|    * 8.5 修改类目 |  | ||||||
|    */ |  | ||||||
|   String OPEN_MODIFY_CATEGORY = "https://api.weixin.qq.com/cgi-bin/wxopen/modifycategory"; |  | ||||||
|  |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 1.获取小程序的信息 |  | ||||||
|    * |  | ||||||
|    * @return . |  | ||||||
|    * @throws WxErrorException . |  | ||||||
|    */ |  | ||||||
|   WxFastMaAccountBasicInfoResult getAccountBasicInfo() throws WxErrorException; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 2.小程序名称设置及改名 |  | ||||||
|    * <pre> |  | ||||||
|    *      若接口未返回audit_id,说明名称已直接设置成功,无需审核;若返回audit_id则名称正在审核中。 |  | ||||||
|    *  </pre> |  | ||||||
|    * |  | ||||||
|    * @param nickname          昵称 |  | ||||||
|    * @param idCard            身份证照片–临时素材mediaid(个人号必填) |  | ||||||
|    * @param license           组织机构代码证或营业执照–临时素材mediaid(组织号必填) |  | ||||||
|    * @param namingOtherStuff1 其他证明材料---临时素材 mediaid |  | ||||||
|    * @param namingOtherStuff2 其他证明材料---临时素材 mediaid |  | ||||||
|    * @return . |  | ||||||
|    * @throws WxErrorException . |  | ||||||
|    */ |  | ||||||
|   WxFastMaSetNickameResult setNickname(String nickname, String idCard, String license, String namingOtherStuff1, |  | ||||||
|                                        String namingOtherStuff2) throws WxErrorException; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 3 小程序改名审核状态查询 |  | ||||||
|    * |  | ||||||
|    * @param auditId 审核单id |  | ||||||
|    * @return . |  | ||||||
|    * @throws WxErrorException . |  | ||||||
|    */ |  | ||||||
|   WxFastMaQueryNicknameStatusResult querySetNicknameStatus(String auditId) throws WxErrorException; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 4. 微信认证名称检测 |  | ||||||
|    * |  | ||||||
|    * @param nickname 名称 |  | ||||||
|    * @return . |  | ||||||
|    * @throws WxErrorException . |  | ||||||
|    */ |  | ||||||
|   WxFastMaCheckNickameResult checkWxVerifyNickname(String nickname) throws WxErrorException; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 5.修改头像 |  | ||||||
|    * <pre> |  | ||||||
|    *     图片格式只支持:BMP、JPEG、JPG、GIF、PNG,大小不超过2M |  | ||||||
|    *      注:实际头像始终为正方形 |  | ||||||
|    * </pre> |  | ||||||
|    * |  | ||||||
|    * @param headImgMediaId 头像素材media_id |  | ||||||
|    * @param x1             裁剪框左上角x坐标(取值范围:[0, 1]) |  | ||||||
|    * @param y1             裁剪框左上角y坐标(取值范围:[0, 1]) |  | ||||||
|    * @param x2             裁剪框右下角x坐标(取值范围:[0, 1]) |  | ||||||
|    * @param y2             裁剪框右下角y坐标(取值范围:[0, 1]) |  | ||||||
|    * @return . |  | ||||||
|    * @throws WxErrorException . |  | ||||||
|    */ |  | ||||||
|   WxOpenResult modifyHeadImage(String headImgMediaId, float x1, float y1, float x2, float y2) throws WxErrorException; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 6.修改功能介绍 |  | ||||||
|    * |  | ||||||
|    * @param signature 简介:4-120字 |  | ||||||
|    * @return . |  | ||||||
|    * @throws WxErrorException . |  | ||||||
|    */ |  | ||||||
|   WxOpenResult modifySignature(String signature) throws WxErrorException; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 7.3 管理员换绑 |  | ||||||
|    * |  | ||||||
|    * @param taskId 换绑管理员任务序列号(公众平台最终点击提交回跳到第三方平台时携带) |  | ||||||
|    * @return . |  | ||||||
|    * @throws WxErrorException . |  | ||||||
|    */ |  | ||||||
|   WxOpenResult componentRebindAdmin(String taskId) throws WxErrorException; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 8.1 获取账号可以设置的所有类目 |  | ||||||
|    * <pre> |  | ||||||
|    *     因为不同类目含有特定字段 |  | ||||||
|    *     目前没有完整的类目信息数据 |  | ||||||
|    *     为保证兼容性,放弃将response转换为实体 |  | ||||||
|    * </pre> |  | ||||||
|    * |  | ||||||
|    * @return . |  | ||||||
|    * @throws WxErrorException . |  | ||||||
|    */ |  | ||||||
|   String getAllCategories() throws WxErrorException; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 8.2添加类目 |  | ||||||
|    * |  | ||||||
|    * @param categoryList 类目列表 |  | ||||||
|    * @return . |  | ||||||
|    * @throws WxErrorException . |  | ||||||
|    */ |  | ||||||
|   WxOpenResult addCategory(List<WxFastMaCategory> categoryList) throws WxErrorException; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 8.3删除类目 |  | ||||||
|    * |  | ||||||
|    * @param first  一级类目ID |  | ||||||
|    * @param second 二级类目ID |  | ||||||
|    * @return . |  | ||||||
|    * @throws WxErrorException . |  | ||||||
|    */ |  | ||||||
|   WxOpenResult deleteCategory(int first, int second) throws WxErrorException; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 8.4获取账号已经设置的所有类目 |  | ||||||
|    * |  | ||||||
|    * @return . |  | ||||||
|    * @throws WxErrorException . |  | ||||||
|    */ |  | ||||||
|   WxFastMaBeenSetCategoryResult getCategory() throws WxErrorException; |  | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 8.5修改类目 |  | ||||||
|    * |  | ||||||
|    * @param category 实体 |  | ||||||
|    * @return . |  | ||||||
|    * @throws WxErrorException . |  | ||||||
|    */ |  | ||||||
|   WxOpenResult modifyCategory(WxFastMaCategory category) throws WxErrorException; |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -0,0 +1,199 @@ | |||||||
|  | package me.chanjar.weixin.open.api; | ||||||
|  |  | ||||||
|  | import me.chanjar.weixin.common.error.WxErrorException; | ||||||
|  | import me.chanjar.weixin.open.bean.ma.WxFastMaCategory; | ||||||
|  | import me.chanjar.weixin.open.bean.result.*; | ||||||
|  |  | ||||||
|  | import java.util.List; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * 微信第三方平台 小程序基础信息接口 (小程序名称、头像、描述、类目等信息设置) | ||||||
|  |  * https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/category/getallcategories.html | ||||||
|  |  * | ||||||
|  |  * @author <a href="https://www.sacoc.cn">广州跨界</a> | ||||||
|  |  */ | ||||||
|  | public interface WxOpenMaBasicService { | ||||||
|  |   /** | ||||||
|  |    * 1 获取帐号基本信息. | ||||||
|  |    */ | ||||||
|  |   String OPEN_GET_ACCOUNT_BASIC_INFO = "https://api.weixin.qq.com/cgi-bin/account/getaccountbasicinfo"; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 2 小程序名称设置及改名. | ||||||
|  |    */ | ||||||
|  |   String OPEN_SET_NICKNAME = "https://api.weixin.qq.com/wxa/setnickname"; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 3 小程序改名审核状态查询. | ||||||
|  |    */ | ||||||
|  |   String OPEN_API_WXA_QUERYNICKNAME = "https://api.weixin.qq.com/wxa/api_wxa_querynickname"; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 4 微信认证名称检测. | ||||||
|  |    */ | ||||||
|  |   String OPEN_CHECK_WX_VERIFY_NICKNAME = "https://api.weixin.qq.com/cgi-bin/wxverify/checkwxverifynickname"; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 5 修改头像. | ||||||
|  |    */ | ||||||
|  |   String OPEN_MODIFY_HEADIMAGE = "https://api.weixin.qq.com/cgi-bin/account/modifyheadimage"; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 6修改功能介绍. | ||||||
|  |    */ | ||||||
|  |   String OPEN_MODIFY_SIGNATURE = "https://api.weixin.qq.com/cgi-bin/account/modifysignature"; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 7 换绑小程序管理员接口. | ||||||
|  |    */ | ||||||
|  |   String OPEN_COMPONENT_REBIND_ADMIN = "https://api.weixin.qq.com/cgi-bin/account/componentrebindadmin"; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 8.1 获取账号可以设置的所有类目 | ||||||
|  |    */ | ||||||
|  |   String OPEN_GET_ALL_CATEGORIES = "https://api.weixin.qq.com/cgi-bin/wxopen/getallcategories"; | ||||||
|  |   /** | ||||||
|  |    * 8.2 添加类目 | ||||||
|  |    */ | ||||||
|  |   String OPEN_ADD_CATEGORY = "https://api.weixin.qq.com/cgi-bin/wxopen/addcategory"; | ||||||
|  |   /** | ||||||
|  |    * 8.3 删除类目 | ||||||
|  |    */ | ||||||
|  |   String OPEN_DELETE_CATEGORY = "https://api.weixin.qq.com/cgi-bin/wxopen/deletecategory"; | ||||||
|  |   /** | ||||||
|  |    * 8.4 获取账号已经设置的所有类目 | ||||||
|  |    */ | ||||||
|  |   String OPEN_GET_CATEGORY = "https://api.weixin.qq.com/cgi-bin/wxopen/getcategory"; | ||||||
|  |   /** | ||||||
|  |    * 8.5 修改类目 | ||||||
|  |    */ | ||||||
|  |   String OPEN_MODIFY_CATEGORY = "https://api.weixin.qq.com/cgi-bin/wxopen/modifycategory"; | ||||||
|  |  | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 1.获取小程序的信息 | ||||||
|  |    * | ||||||
|  |    * @return . | ||||||
|  |    * @throws WxErrorException . | ||||||
|  |    */ | ||||||
|  |   WxFastMaAccountBasicInfoResult getAccountBasicInfo() throws WxErrorException; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 2.小程序名称设置及改名 | ||||||
|  |    * <pre> | ||||||
|  |    *      若接口未返回audit_id,说明名称已直接设置成功,无需审核;若返回audit_id则名称正在审核中。 | ||||||
|  |    *  </pre> | ||||||
|  |    * | ||||||
|  |    * @param nickname          昵称 | ||||||
|  |    * @param idCard            身份证照片–临时素材mediaid(个人号必填) | ||||||
|  |    * @param license           组织机构代码证或营业执照–临时素材mediaid(组织号必填) | ||||||
|  |    * @param namingOtherStuff1 其他证明材料---临时素材 mediaid | ||||||
|  |    * @param namingOtherStuff2 其他证明材料---临时素材 mediaid | ||||||
|  |    * @return . | ||||||
|  |    * @throws WxErrorException . | ||||||
|  |    */ | ||||||
|  |   WxFastMaSetNickameResult setNickname(String nickname, String idCard, String license, String namingOtherStuff1, | ||||||
|  |                                        String namingOtherStuff2) throws WxErrorException; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 3 小程序改名审核状态查询 | ||||||
|  |    * | ||||||
|  |    * @param auditId 审核单id | ||||||
|  |    * @return . | ||||||
|  |    * @throws WxErrorException . | ||||||
|  |    */ | ||||||
|  |   WxFastMaQueryNicknameStatusResult querySetNicknameStatus(String auditId) throws WxErrorException; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 4. 微信认证名称检测 | ||||||
|  |    * | ||||||
|  |    * @param nickname 名称 | ||||||
|  |    * @return . | ||||||
|  |    * @throws WxErrorException . | ||||||
|  |    */ | ||||||
|  |   WxFastMaCheckNickameResult checkWxVerifyNickname(String nickname) throws WxErrorException; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 5.修改头像 | ||||||
|  |    * <pre> | ||||||
|  |    *     图片格式只支持:BMP、JPEG、JPG、GIF、PNG,大小不超过2M | ||||||
|  |    *      注:实际头像始终为正方形 | ||||||
|  |    * </pre> | ||||||
|  |    * | ||||||
|  |    * @param headImgMediaId 头像素材media_id | ||||||
|  |    * @param x1             裁剪框左上角x坐标(取值范围:[0, 1]) | ||||||
|  |    * @param y1             裁剪框左上角y坐标(取值范围:[0, 1]) | ||||||
|  |    * @param x2             裁剪框右下角x坐标(取值范围:[0, 1]) | ||||||
|  |    * @param y2             裁剪框右下角y坐标(取值范围:[0, 1]) | ||||||
|  |    * @return . | ||||||
|  |    * @throws WxErrorException . | ||||||
|  |    */ | ||||||
|  |   WxOpenResult modifyHeadImage(String headImgMediaId, float x1, float y1, float x2, float y2) throws WxErrorException; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 6.修改功能介绍 | ||||||
|  |    * | ||||||
|  |    * @param signature 简介:4-120字 | ||||||
|  |    * @return . | ||||||
|  |    * @throws WxErrorException . | ||||||
|  |    */ | ||||||
|  |   WxOpenResult modifySignature(String signature) throws WxErrorException; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 7.3 管理员换绑 | ||||||
|  |    * | ||||||
|  |    * @param taskId 换绑管理员任务序列号(公众平台最终点击提交回跳到第三方平台时携带) | ||||||
|  |    * @return . | ||||||
|  |    * @throws WxErrorException . | ||||||
|  |    */ | ||||||
|  |   WxOpenResult componentRebindAdmin(String taskId) throws WxErrorException; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 8.1 获取账号可以设置的所有类目 | ||||||
|  |    * <pre> | ||||||
|  |    *     因为不同类目含有特定字段 | ||||||
|  |    *     目前没有完整的类目信息数据 | ||||||
|  |    *     为保证兼容性,放弃将response转换为实体 | ||||||
|  |    * </pre> | ||||||
|  |    * | ||||||
|  |    * @return . | ||||||
|  |    * @throws WxErrorException . | ||||||
|  |    */ | ||||||
|  |   String getAllCategories() throws WxErrorException; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 8.2添加类目 | ||||||
|  |    * | ||||||
|  |    * @param categoryList 类目列表 | ||||||
|  |    * @return . | ||||||
|  |    * @throws WxErrorException . | ||||||
|  |    */ | ||||||
|  |   WxOpenResult addCategory(List<WxFastMaCategory> categoryList) throws WxErrorException; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 8.3删除类目 | ||||||
|  |    * | ||||||
|  |    * @param first  一级类目ID | ||||||
|  |    * @param second 二级类目ID | ||||||
|  |    * @return . | ||||||
|  |    * @throws WxErrorException . | ||||||
|  |    */ | ||||||
|  |   WxOpenResult deleteCategory(int first, int second) throws WxErrorException; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 8.4获取账号已经设置的所有类目 | ||||||
|  |    * | ||||||
|  |    * @return . | ||||||
|  |    * @throws WxErrorException . | ||||||
|  |    */ | ||||||
|  |   WxFastMaBeenSetCategoryResult getCategory() throws WxErrorException; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 8.5修改类目 | ||||||
|  |    * | ||||||
|  |    * @param category 实体 | ||||||
|  |    * @return . | ||||||
|  |    * @throws WxErrorException . | ||||||
|  |    */ | ||||||
|  |   WxOpenResult modifyCategory(WxFastMaCategory category) throws WxErrorException; | ||||||
|  | } | ||||||
| @ -452,6 +452,16 @@ public interface WxOpenMaService extends WxMaService { | |||||||
|    */ |    */ | ||||||
|   WxOpenResult revertCodeRelease() throws WxErrorException; |   WxOpenResult revertCodeRelease() throws WxErrorException; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 获取可回退的小程序版本 | ||||||
|  |    * 调用本接口可以获取可回退的小程序版本(最多保存最近发布或回退的5个版本 | ||||||
|  |    * 文档地址: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/code/get_history_version.html | ||||||
|  |    * | ||||||
|  |    * @return 历史版本信息 | ||||||
|  |    * @throws WxErrorException 如果调用微信接口失败抛出此异常 | ||||||
|  |    */ | ||||||
|  |   WxOpenMaHistoryVersionResult getHistoryVersion() throws WxErrorException; | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * 15. 小程序审核撤回 |    * 15. 小程序审核撤回 | ||||||
|    * <p> |    * <p> | ||||||
| @ -583,4 +593,11 @@ public interface WxOpenMaService extends WxMaService { | |||||||
|    * @throws WxErrorException the wx error exception |    * @throws WxErrorException the wx error exception | ||||||
|    */ |    */ | ||||||
|   WxOpenResult publishQrcodeJump(String prefix) throws WxErrorException; |   WxOpenResult publishQrcodeJump(String prefix) throws WxErrorException; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 小程序基础信息服务  (小程序名称、头像、描述、类目等信息设置) | ||||||
|  |    * | ||||||
|  |    * @return 小程序基础信息服务 | ||||||
|  |    */ | ||||||
|  |   WxOpenMaBasicService getBasicService(); | ||||||
| } | } | ||||||
|  | |||||||
| @ -20,7 +20,9 @@ import java.util.Map; | |||||||
|  * |  * | ||||||
|  * @author Hipple |  * @author Hipple | ||||||
|  * @since 2019/1/23 15:27 |  * @since 2019/1/23 15:27 | ||||||
|  |  * @deprecated 请使用 {@link WxOpenMaServiceImpl} 替代 | ||||||
|  */ |  */ | ||||||
|  | @Deprecated | ||||||
| public class WxOpenFastMaServiceImpl extends WxMaServiceImpl implements WxOpenFastMaService { | public class WxOpenFastMaServiceImpl extends WxMaServiceImpl implements WxOpenFastMaService { | ||||||
|   private final WxOpenComponentService wxOpenComponentService; |   private final WxOpenComponentService wxOpenComponentService; | ||||||
|   private final WxMaConfig wxMaConfig; |   private final WxMaConfig wxMaConfig; | ||||||
|  | |||||||
| @ -0,0 +1,135 @@ | |||||||
|  | package me.chanjar.weixin.open.api.impl; | ||||||
|  |  | ||||||
|  | import cn.binarywang.wx.miniapp.api.WxMaService; | ||||||
|  | import com.google.gson.JsonArray; | ||||||
|  | import com.google.gson.JsonObject; | ||||||
|  | import me.chanjar.weixin.common.error.WxErrorException; | ||||||
|  | import me.chanjar.weixin.open.api.WxOpenMaBasicService; | ||||||
|  | import me.chanjar.weixin.open.bean.ma.WxFastMaCategory; | ||||||
|  | import me.chanjar.weixin.open.bean.result.*; | ||||||
|  | import me.chanjar.weixin.open.util.json.WxOpenGsonBuilder; | ||||||
|  |  | ||||||
|  | import java.util.HashMap; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.Map; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * 微信第三方平台 小程序基础信息接口 | ||||||
|  |  * | ||||||
|  |  * @author <a href="https://www.sacoc.cn">广州跨界</a> | ||||||
|  |  */ | ||||||
|  | public class WxOpenMaBasicServiceImpl implements WxOpenMaBasicService { | ||||||
|  |  | ||||||
|  |   private final WxMaService wxMaService; | ||||||
|  |  | ||||||
|  |   public WxOpenMaBasicServiceImpl(WxMaService wxMaService) { | ||||||
|  |     this.wxMaService = wxMaService; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public WxFastMaAccountBasicInfoResult getAccountBasicInfo() throws WxErrorException { | ||||||
|  |     String response = wxMaService.get(OPEN_GET_ACCOUNT_BASIC_INFO, ""); | ||||||
|  |     return WxOpenGsonBuilder.create().fromJson(response, WxFastMaAccountBasicInfoResult.class); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public WxFastMaSetNickameResult setNickname(String nickname, String idCard, String license, String namingOtherStuff1, String namingOtherStuff2) throws WxErrorException { | ||||||
|  |     JsonObject params = new JsonObject(); | ||||||
|  |     params.addProperty("nick_name", nickname); | ||||||
|  |     params.addProperty("id_card", idCard); | ||||||
|  |     params.addProperty("license", license); | ||||||
|  |     params.addProperty("naming_other_stuff_1", namingOtherStuff1); | ||||||
|  |     params.addProperty("naming_other_stuff_2", namingOtherStuff2); | ||||||
|  |     String response = wxMaService.post(OPEN_SET_NICKNAME, params); | ||||||
|  |     return WxOpenGsonBuilder.create().fromJson(response, WxFastMaSetNickameResult.class); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public WxFastMaQueryNicknameStatusResult querySetNicknameStatus(String auditId) throws WxErrorException { | ||||||
|  |     JsonObject params = new JsonObject(); | ||||||
|  |     params.addProperty("audit_id", auditId); | ||||||
|  |     String response = wxMaService.post(OPEN_API_WXA_QUERYNICKNAME, params); | ||||||
|  |     return WxOpenGsonBuilder.create().fromJson(response, WxFastMaQueryNicknameStatusResult.class); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public WxFastMaCheckNickameResult checkWxVerifyNickname(String nickname) throws WxErrorException { | ||||||
|  |     JsonObject params = new JsonObject(); | ||||||
|  |     params.addProperty("nick_name", nickname); | ||||||
|  |     String response = wxMaService.post(OPEN_CHECK_WX_VERIFY_NICKNAME, params); | ||||||
|  |     return WxOpenGsonBuilder.create().fromJson(response, WxFastMaCheckNickameResult.class); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public WxOpenResult modifyHeadImage(String headImgMediaId, float x1, float y1, float x2, float y2) throws WxErrorException { | ||||||
|  |     JsonObject params = new JsonObject(); | ||||||
|  |     params.addProperty("head_img_media_id", headImgMediaId); | ||||||
|  |     params.addProperty("x1", x1); | ||||||
|  |     params.addProperty("y1", y1); | ||||||
|  |     params.addProperty("x2", x2); | ||||||
|  |     params.addProperty("y2", y2); | ||||||
|  |     String response = wxMaService.post(OPEN_MODIFY_HEADIMAGE, params); | ||||||
|  |     return WxOpenGsonBuilder.create().fromJson(response, WxOpenResult.class); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public WxOpenResult modifySignature(String signature) throws WxErrorException { | ||||||
|  |     JsonObject params = new JsonObject(); | ||||||
|  |     params.addProperty("signature", signature); | ||||||
|  |     String response = wxMaService.post(OPEN_MODIFY_SIGNATURE, params); | ||||||
|  |     return WxOpenGsonBuilder.create().fromJson(response, WxOpenResult.class); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public WxOpenResult componentRebindAdmin(String taskid) throws WxErrorException { | ||||||
|  |     JsonObject params = new JsonObject(); | ||||||
|  |     params.addProperty("taskid", taskid); | ||||||
|  |     String response = wxMaService.post(OPEN_COMPONENT_REBIND_ADMIN, params); | ||||||
|  |     return WxOpenGsonBuilder.create().fromJson(response, WxOpenResult.class); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public String getAllCategories() throws WxErrorException { | ||||||
|  |     return wxMaService.get(OPEN_GET_ALL_CATEGORIES, ""); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public WxOpenResult addCategory(List<WxFastMaCategory> categoryList) throws WxErrorException { | ||||||
|  |     Map<String, Object> map = new HashMap<>(); | ||||||
|  |     map.put("categories", categoryList); | ||||||
|  |     String response = wxMaService.post(OPEN_ADD_CATEGORY, WxOpenGsonBuilder.create().toJson(map)); | ||||||
|  |     return WxOpenGsonBuilder.create().fromJson(response, WxOpenResult.class); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public WxOpenResult deleteCategory(int first, int second) throws WxErrorException { | ||||||
|  |     JsonObject params = new JsonObject(); | ||||||
|  |     params.addProperty("first", first); | ||||||
|  |     params.addProperty("second", second); | ||||||
|  |     String response = wxMaService.post(OPEN_DELETE_CATEGORY, params); | ||||||
|  |     return WxOpenGsonBuilder.create().fromJson(response, WxOpenResult.class); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public WxFastMaBeenSetCategoryResult getCategory() throws WxErrorException { | ||||||
|  |     String response = wxMaService.get(OPEN_GET_CATEGORY, ""); | ||||||
|  |     return WxOpenGsonBuilder.create().fromJson(response, WxFastMaBeenSetCategoryResult.class); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public WxOpenResult modifyCategory(WxFastMaCategory category) throws WxErrorException { | ||||||
|  |     String response = wxMaService.post(OPEN_MODIFY_CATEGORY, category); | ||||||
|  |     return WxOpenGsonBuilder.create().fromJson(response, WxOpenResult.class); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   private JsonArray toJsonArray(List<String> strList) { | ||||||
|  |     JsonArray jsonArray = new JsonArray(); | ||||||
|  |     if (strList != null && !strList.isEmpty()) { | ||||||
|  |       for (String str : strList) { | ||||||
|  |         jsonArray.add(str); | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |     return jsonArray; | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -7,8 +7,10 @@ import cn.binarywang.wx.miniapp.config.WxMaConfig; | |||||||
| import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder; | import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder; | ||||||
| import com.google.gson.JsonArray; | import com.google.gson.JsonArray; | ||||||
| import com.google.gson.JsonObject; | import com.google.gson.JsonObject; | ||||||
|  | import lombok.Getter; | ||||||
| import me.chanjar.weixin.common.error.WxErrorException; | import me.chanjar.weixin.common.error.WxErrorException; | ||||||
| import me.chanjar.weixin.open.api.WxOpenComponentService; | import me.chanjar.weixin.open.api.WxOpenComponentService; | ||||||
|  | import me.chanjar.weixin.open.api.WxOpenMaBasicService; | ||||||
| import me.chanjar.weixin.open.api.WxOpenMaService; | import me.chanjar.weixin.open.api.WxOpenMaService; | ||||||
| import me.chanjar.weixin.open.bean.ma.WxMaOpenCommitExtInfo; | import me.chanjar.weixin.open.bean.ma.WxMaOpenCommitExtInfo; | ||||||
| import me.chanjar.weixin.open.bean.ma.WxMaQrcodeParam; | import me.chanjar.weixin.open.bean.ma.WxMaQrcodeParam; | ||||||
| @ -34,11 +36,14 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ | |||||||
|   private final WxOpenComponentService wxOpenComponentService; |   private final WxOpenComponentService wxOpenComponentService; | ||||||
|   private final WxMaConfig wxMaConfig; |   private final WxMaConfig wxMaConfig; | ||||||
|   private final String appId; |   private final String appId; | ||||||
|  |   @Getter | ||||||
|  |   private final WxOpenMaBasicService basicService; | ||||||
|  |  | ||||||
|   public WxOpenMaServiceImpl(WxOpenComponentService wxOpenComponentService, String appId, WxMaConfig wxMaConfig) { |   public WxOpenMaServiceImpl(WxOpenComponentService wxOpenComponentService, String appId, WxMaConfig wxMaConfig) { | ||||||
|     this.wxOpenComponentService = wxOpenComponentService; |     this.wxOpenComponentService = wxOpenComponentService; | ||||||
|     this.appId = appId; |     this.appId = appId; | ||||||
|     this.wxMaConfig = wxMaConfig; |     this.wxMaConfig = wxMaConfig; | ||||||
|  |     this.basicService = new WxOpenMaBasicServiceImpl(this); | ||||||
|     initHttp(); |     initHttp(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @ -247,6 +252,12 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ | |||||||
|     return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); |     return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public WxOpenMaHistoryVersionResult getHistoryVersion() throws WxErrorException { | ||||||
|  |     String response = get(API_REVERT_CODE_RELEASE, "action=get_history_version"); | ||||||
|  |     return WxMaGsonBuilder.create().fromJson(response, WxOpenMaHistoryVersionResult.class); | ||||||
|  |   } | ||||||
|  |  | ||||||
|   @Override |   @Override | ||||||
|   public WxOpenResult undoCodeAudit() throws WxErrorException { |   public WxOpenResult undoCodeAudit() throws WxErrorException { | ||||||
|     String response = get(API_UNDO_CODE_AUDIT, null); |     String response = get(API_UNDO_CODE_AUDIT, null); | ||||||
|  | |||||||
| @ -0,0 +1,34 @@ | |||||||
|  | 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 <a href="https://www.sacoc.cn">广州跨界</a> | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class WxOpenMaHistoryVersion implements Serializable { | ||||||
|  |   private static final long serialVersionUID = 98923601148793365L; | ||||||
|  |  | ||||||
|  |   @SerializedName("app_version") | ||||||
|  |   private Integer appVersion; | ||||||
|  |  | ||||||
|  |   @SerializedName("user_version") | ||||||
|  |   private String userVersion; | ||||||
|  |  | ||||||
|  |   @SerializedName("user_desc") | ||||||
|  |   private String userDesc; | ||||||
|  |  | ||||||
|  |   @SerializedName("commit_time") | ||||||
|  |   private Integer commitTime; | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public String toString() { | ||||||
|  |     return WxOpenGsonBuilder.create().toJson(this); | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -0,0 +1,29 @@ | |||||||
|  | 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.WxOpenMaHistoryVersion; | ||||||
|  | import me.chanjar.weixin.open.util.json.WxOpenGsonBuilder; | ||||||
|  |  | ||||||
|  | import java.util.List; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * 微信开放平台小程序 可回退的小程序版本 返回 | ||||||
|  |  * | ||||||
|  |  * @author <a href="https://www.sacoc.cn">广州跨界</a> | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = true) | ||||||
|  | public class WxOpenMaHistoryVersionResult extends WxOpenResult { | ||||||
|  |   private static final long serialVersionUID = 4102311851687901079L; | ||||||
|  |  | ||||||
|  |   @SerializedName("template_list") | ||||||
|  |   List<WxOpenMaHistoryVersion> templateList; | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   public String toString() { | ||||||
|  |     return WxOpenGsonBuilder.create().toJson(this); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user
	 hywr
					hywr