-
-
Notifications
You must be signed in to change notification settings - Fork 9k
企业微信服务商代开发API封装 #3853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
企业微信服务商代开发API封装 #3853
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
69715f1
Initial plan
Copilot 3884ecf
新增:企业微信服务商代开发API封装
Copilot e0e51f9
修复:代码审查问题 - 移除未使用的import和使用ArgumentMatchers
Copilot d9515ef
修复:测试类中的类型不匹配和deprecated方法
Copilot 44ab3d7
Update weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpC…
binarywang 1ec2bc5
Update weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpT…
binarywang e93b4b3
重构:添加辅助方法提高代码可维护性
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
221 changes: 221 additions & 0 deletions
221
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpCustomizedAppDetail.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,221 @@ | ||
| package me.chanjar.weixin.cp.bean; | ||
|
|
||
| import com.google.gson.annotations.SerializedName; | ||
| import lombok.Data; | ||
| import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; | ||
|
|
||
| import java.io.Serializable; | ||
| import java.util.List; | ||
|
|
||
| /** | ||
| * 代开发应用详情. | ||
| * | ||
| * @author <a href="https://github.com/binarywang">Binary Wang</a> | ||
| * created on 2026-01-14 | ||
| */ | ||
| @Data | ||
| public class WxCpTpCustomizedAppDetail extends WxCpBaseResp { | ||
|
|
||
| /** | ||
| * 授权方企业id | ||
| */ | ||
| @SerializedName("auth_corpid") | ||
| private String authCorpId; | ||
|
|
||
| /** | ||
| * 授权方企业名称 | ||
| */ | ||
| @SerializedName("auth_corp_name") | ||
| private String authCorpName; | ||
|
|
||
| /** | ||
| * 授权方企业方形头像 | ||
| */ | ||
| @SerializedName("auth_corp_square_logo_url") | ||
| private String authCorpSquareLogoUrl; | ||
|
|
||
| /** | ||
| * 授权方企业圆形头像 | ||
| */ | ||
| @SerializedName("auth_corp_round_logo_url") | ||
| private String authCorpRoundLogoUrl; | ||
|
|
||
| /** | ||
| * 授权方企业类型,1. 企业; 2. 政府以及事业单位; 3. 其他组织, 4.团队小型企业(原企业微信认证版用户) | ||
| */ | ||
| @SerializedName("auth_corp_type") | ||
| private Integer authCorpType; | ||
|
|
||
| /** | ||
| * 授权方企业在微工作台(原企业号)的二维码,可用于关注微工作台 | ||
| */ | ||
| @SerializedName("auth_corp_qrcode_url") | ||
| private String authCorpQrcodeUrl; | ||
|
|
||
| /** | ||
| * 授权方企业用户规模 | ||
| */ | ||
| @SerializedName("auth_corp_user_limit") | ||
| private Integer authCorpUserLimit; | ||
|
|
||
| /** | ||
| * 授权方企业的主体名称(仅认证或验证过的企业有),即企业全称 | ||
| */ | ||
| @SerializedName("auth_corp_full_name") | ||
| private String authCorpFullName; | ||
|
|
||
| /** | ||
| * 企业类型,1. 已验证企业;2. 已认证企业 | ||
| */ | ||
| @SerializedName("auth_corp_verified_type") | ||
| private Integer authCorpVerifiedType; | ||
|
|
||
| /** | ||
| * 授权方企业所属行业 | ||
| */ | ||
| @SerializedName("auth_corp_industry") | ||
| private String authCorpIndustry; | ||
|
|
||
| /** | ||
| * 授权方企业所属子行业 | ||
| */ | ||
| @SerializedName("auth_corp_sub_industry") | ||
| private String authCorpSubIndustry; | ||
|
|
||
| /** | ||
| * 授权方企业所在地址 | ||
| */ | ||
| @SerializedName("auth_corp_location") | ||
| private String authCorpLocation; | ||
|
|
||
| /** | ||
| * 代开发自建应用详情 | ||
| */ | ||
| @SerializedName("customized_app_list") | ||
| private List<CustomizedApp> customizedAppList; | ||
|
|
||
| /** | ||
| * From json wx cp tp customized app detail. | ||
| * | ||
| * @param json the json | ||
| * @return the wx cp tp customized app detail | ||
| */ | ||
| public static WxCpTpCustomizedAppDetail fromJson(String json) { | ||
| return WxCpGsonBuilder.create().fromJson(json, WxCpTpCustomizedAppDetail.class); | ||
| } | ||
|
|
||
| @Override | ||
| public String toJson() { | ||
| return WxCpGsonBuilder.create().toJson(this); | ||
| } | ||
|
|
||
| /** | ||
| * 代开发自建应用信息 | ||
| */ | ||
| @Data | ||
| public static class CustomizedApp implements Serializable { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| /** | ||
| * 代开发自建应用的agentid | ||
| */ | ||
| @SerializedName("agentid") | ||
| private Integer agentId; | ||
|
|
||
| /** | ||
| * 代开发自建应用对应的模板id | ||
| */ | ||
| @SerializedName("template_id") | ||
| private String templateId; | ||
|
|
||
| /** | ||
| * 代开发自建应用的name | ||
| */ | ||
| @SerializedName("name") | ||
| private String name; | ||
|
|
||
| /** | ||
| * 代开发自建应用的description | ||
| */ | ||
| @SerializedName("description") | ||
| private String description; | ||
|
|
||
| /** | ||
| * 代开发自建应用的logo url | ||
| */ | ||
| @SerializedName("logo_url") | ||
| private String logoUrl; | ||
|
|
||
| /** | ||
| * 代开发自建应用的可见范围 | ||
| */ | ||
| @SerializedName("allow_userinfos") | ||
| private AllowUserInfos allowUserInfos; | ||
|
|
||
| /** | ||
| * 代开发自建应用是否被禁用 | ||
| */ | ||
| @SerializedName("close") | ||
| private Integer close; | ||
|
|
||
| /** | ||
| * 代开发自建应用主页url | ||
| */ | ||
| @SerializedName("home_url") | ||
| private String homeUrl; | ||
|
|
||
| /** | ||
| * 代开发自建应用的模式,0 = 代开发自建应用;1 = 第三方应用代开发 | ||
| */ | ||
| @SerializedName("app_type") | ||
| private Integer appType; | ||
| } | ||
|
|
||
| /** | ||
| * 应用可见范围 | ||
| */ | ||
| @Data | ||
| public static class AllowUserInfos implements Serializable { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| /** | ||
| * 应用可见范围(成员) | ||
| */ | ||
| @SerializedName("user") | ||
| private List<User> users; | ||
|
|
||
| /** | ||
| * 应用可见范围(部门) | ||
| */ | ||
| @SerializedName("department") | ||
| private List<Department> departments; | ||
| } | ||
|
|
||
| /** | ||
| * 成员信息 | ||
| */ | ||
| @Data | ||
| public static class User implements Serializable { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| /** | ||
| * 成员userid | ||
| */ | ||
| @SerializedName("userid") | ||
| private String userId; | ||
| } | ||
|
|
||
| /** | ||
| * 部门信息 | ||
| */ | ||
| @Data | ||
| public static class Department implements Serializable { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| /** | ||
| * 部门id | ||
| */ | ||
| @SerializedName("id") | ||
| private Integer id; | ||
| } | ||
| } | ||
83 changes: 83 additions & 0 deletions
83
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpTemplateList.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| package me.chanjar.weixin.cp.bean; | ||
|
|
||
| import com.google.gson.annotations.SerializedName; | ||
| import lombok.Data; | ||
| import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; | ||
|
|
||
| import java.io.Serializable; | ||
| import java.util.List; | ||
|
|
||
| /** | ||
| * 应用模板列表. | ||
| * | ||
| * @author <a href="https://github.com/binarywang">Binary Wang</a> | ||
| * created on 2026-01-14 | ||
| */ | ||
| @Data | ||
| public class WxCpTpTemplateList extends WxCpBaseResp { | ||
|
|
||
| /** | ||
| * 应用模板列表 | ||
| */ | ||
| @SerializedName("template_list") | ||
| private List<Template> templateList; | ||
|
|
||
| /** | ||
| * From json wx cp tp template list. | ||
| * | ||
| * @param json the json | ||
| * @return the wx cp tp template list | ||
| */ | ||
| public static WxCpTpTemplateList fromJson(String json) { | ||
| return WxCpGsonBuilder.create().fromJson(json, WxCpTpTemplateList.class); | ||
| } | ||
|
|
||
binarywang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| @Override | ||
| public String toJson() { | ||
| return WxCpGsonBuilder.create().toJson(this); | ||
| } | ||
|
|
||
| /** | ||
| * 应用模板信息 | ||
| */ | ||
| @Data | ||
| public static class Template implements Serializable { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| /** | ||
| * 模板id | ||
| */ | ||
| @SerializedName("template_id") | ||
| private String templateId; | ||
|
|
||
| /** | ||
| * 模板类型 | ||
| */ | ||
| @SerializedName("template_type") | ||
| private Integer templateType; | ||
|
|
||
| /** | ||
| * 应用名称 | ||
| */ | ||
| @SerializedName("app_name") | ||
| private String appName; | ||
|
|
||
| /** | ||
| * 应用logo url | ||
| */ | ||
| @SerializedName("logo_url") | ||
| private String logoUrl; | ||
|
|
||
| /** | ||
| * 应用简介 | ||
| */ | ||
| @SerializedName("app_desc") | ||
| private String appDesc; | ||
|
|
||
| /** | ||
| * 应用状态 | ||
| */ | ||
| @SerializedName("status") | ||
| private Integer status; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpCustomizedService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package me.chanjar.weixin.cp.tp.service; | ||
|
|
||
| import me.chanjar.weixin.common.error.WxErrorException; | ||
| import me.chanjar.weixin.cp.bean.WxCpTpCustomizedAppDetail; | ||
| import me.chanjar.weixin.cp.bean.WxCpTpTemplateList; | ||
|
|
||
| /** | ||
| * 企业微信第三方应用 - 代开发相关接口. | ||
| * | ||
| * @author <a href="https://github.com/binarywang">Binary Wang</a> | ||
| * created on 2026-01-14 | ||
| */ | ||
| public interface WxCpTpCustomizedService { | ||
|
|
||
| /** | ||
| * 获取应用模板列表 | ||
| * <pre> | ||
| * 服务商可通过本接口获取服务商所拥有的应用模板列表 | ||
| * 文档地址:https://developer.work.weixin.qq.com/document/path/97111 | ||
| * </pre> | ||
| * | ||
| * @return 应用模板列表 | ||
| * @throws WxErrorException 微信错误异常 | ||
| */ | ||
| WxCpTpTemplateList getTemplateList() throws WxErrorException; | ||
|
|
||
| /** | ||
| * 获取代开发应用详情 | ||
| * <pre> | ||
| * 服务商可通过本接口获取某个授权企业中已经安装的代开发自建应用的详情 | ||
| * 文档地址:https://developer.work.weixin.qq.com/document/path/97111 | ||
| * </pre> | ||
| * | ||
| * @param authCorpId 授权企业的corpid | ||
| * @param agentId 应用的agentid,为空时则返回该企业所有的代开发自建应用详情 | ||
| * @return 代开发应用详情 | ||
| * @throws WxErrorException 微信错误异常 | ||
| */ | ||
| WxCpTpCustomizedAppDetail getCustomizedAppDetail(String authCorpId, Integer agentId) throws WxErrorException; | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.