-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,927 additions
and
12 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpCorpGroupService.java
This file contains 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,18 @@ | ||
package me.chanjar.weixin.cp.api; | ||
|
||
import me.chanjar.weixin.common.error.WxErrorException; | ||
import me.chanjar.weixin.cp.bean.corpgroup.*; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @Project: WxJava | ||
* @Package: me.chanjar.weixin.cp.api | ||
* @Description: 企业互联相关接口 | ||
* @Author: libo | ||
* @Email: 422423229@qq.com | ||
* @Date: 27/2/2023 9:57 PM | ||
*/ | ||
public interface WxCpCorpGroupService { | ||
List<WxCpCorpGroupCorp> listAppShareInfo(Integer agentId,Integer businessType,String corpId,Integer limit,String cursor) throws WxErrorException; | ||
} |
This file contains 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
This file contains 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
48 changes: 48 additions & 0 deletions
48
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpCorpGroupServiceImpl.java
This file contains 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,48 @@ | ||
package me.chanjar.weixin.cp.api.impl; | ||
|
||
import com.google.gson.JsonObject; | ||
import com.google.gson.reflect.TypeToken; | ||
import lombok.RequiredArgsConstructor; | ||
import me.chanjar.weixin.common.error.WxErrorException; | ||
import me.chanjar.weixin.common.util.json.GsonParser; | ||
import me.chanjar.weixin.cp.api.WxCpCorpGroupService; | ||
import me.chanjar.weixin.cp.api.WxCpService; | ||
import me.chanjar.weixin.cp.bean.corpgroup.*; | ||
import me.chanjar.weixin.cp.constant.WxCpApiPathConsts; | ||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; | ||
|
||
import java.util.List; | ||
|
||
import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.CorpGroup.*; | ||
import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.LinkedCorp.GET_PERM_LIST; | ||
|
||
/** | ||
* @Project: WxJava | ||
* @Package: me.chanjar.weixin.cp.api.impl | ||
* @Description: 企业互联相关接口实现类 | ||
* @Author: libo | ||
* @Email: 422423229@qq.com | ||
* @Date: 27/2/2023 10:02 PM | ||
*/ | ||
@RequiredArgsConstructor | ||
public class WxCpCorpGroupServiceImpl implements WxCpCorpGroupService { | ||
private final WxCpService cpService; | ||
|
||
@Override | ||
public List<WxCpCorpGroupCorp> listAppShareInfo(Integer agentId, Integer businessType, String corpId, Integer limit, String cursor) throws WxErrorException { | ||
final String url = this.cpService.getWxCpConfigStorage().getApiUrl(LIST_SHARE_APP_INFO); | ||
JsonObject jsonObject = new JsonObject(); | ||
jsonObject.addProperty("agentid", agentId); | ||
jsonObject.addProperty("corpid", corpId); | ||
jsonObject.addProperty("business_type", businessType); | ||
jsonObject.addProperty("limit", limit); | ||
jsonObject.addProperty("cursor", cursor); | ||
String responseContent = this.cpService.post(url, jsonObject); | ||
JsonObject tmpJson = GsonParser.parse(responseContent); | ||
|
||
return WxCpGsonBuilder.create().fromJson(tmpJson.get("corp_list"), | ||
new TypeToken<List<WxCpCorpGroupCorpListAppShareInfoResp>>() { | ||
}.getType() | ||
); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/corpgroup/WxCpCorpGroupCorp.java
This file contains 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,43 @@ | ||
package me.chanjar.weixin.cp.bean.corpgroup; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* @Project: WxJava | ||
* @Package: me.chanjar.weixin.cp.bean.corpgroup | ||
* @Description: 应用类 | ||
* @Author: libo | ||
* @Email: 422423229@qq.com | ||
* @Date: 27/2/2023 9:50 PM | ||
*/ | ||
@NoArgsConstructor | ||
@Data | ||
public class WxCpCorpGroupCorp implements Serializable { | ||
|
||
private static final long serialVersionUID = 6842919838272832415L; | ||
@SerializedName("corpid") | ||
private String corpid; | ||
@SerializedName("corp_name") | ||
private String corpName; | ||
@SerializedName("agentid") | ||
private Integer agentid; | ||
|
||
public static WxCpCorpGroupCorp fromJson(String json) { | ||
return WxCpGsonBuilder.create().fromJson(json, WxCpCorpGroupCorp.class); | ||
} | ||
|
||
/** | ||
* To json string. | ||
* | ||
* @return the string | ||
*/ | ||
public String toJson() { | ||
return WxCpGsonBuilder.create().toJson(this); | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...va-cp/src/main/java/me/chanjar/weixin/cp/bean/corpgroup/WxCpCorpGroupCorpGetTokenReq.java
This file contains 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,25 @@ | ||
package me.chanjar.weixin.cp.bean.corpgroup; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Data; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* @Project: WxJava | ||
* @Package: me.chanjar.weixin.cp.bean.corpgroup | ||
* @Description: 获取下级/下游企业的access_token | ||
* @Author: libo | ||
* @Email: 422423229@qq.com | ||
* @Date: 27/2/2023 9:07 PM | ||
*/ | ||
@Data | ||
public class WxCpCorpGroupCorpGetTokenReq implements Serializable { | ||
private static final long serialVersionUID = -1876754768932436524L; | ||
@SerializedName("corpid") | ||
private String corpId; | ||
@SerializedName("business_type") | ||
private int businessType; | ||
@SerializedName("agentid") | ||
private int agentId; | ||
} |
27 changes: 27 additions & 0 deletions
27
.../main/java/me/chanjar/weixin/cp/bean/corpgroup/WxCpCorpGroupCorpListAppShareInfoResp.java
This file contains 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,27 @@ | ||
package me.chanjar.weixin.cp.bean.corpgroup; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Data; | ||
import me.chanjar.weixin.cp.bean.WxCpBaseResp; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
|
||
/** | ||
* @Project: WxJava | ||
* @Package: me.chanjar.weixin.cp.bean.corpgroup | ||
* @Description: 获取应用共享信息返回类 | ||
* @Author: libo | ||
* @Email: 422423229@qq.com | ||
* @Date: 27/2/2023 9:02 PM | ||
*/ | ||
@Data | ||
public class WxCpCorpGroupCorpListAppShareInfoResp implements Serializable { | ||
private static final long serialVersionUID = 7165788382879237583L; | ||
@SerializedName("ending") | ||
private int ending; | ||
@SerializedName("corp_list") | ||
private List<WxCpCorpGroupCorp> corpList; | ||
@SerializedName("next_cursor") | ||
private String nextCursor; | ||
} |
38 changes: 38 additions & 0 deletions
38
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/corpgroup/WxCpCorpGroupCorpToken.java
This file contains 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,38 @@ | ||
package me.chanjar.weixin.cp.bean.corpgroup; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Data; | ||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* @Project: WxJava | ||
* @Package: me.chanjar.weixin.cp.bean.corpgroup | ||
* @Description: 获取下级/下游企业的access_token返回类 | ||
* @Author: libo | ||
* @Email: 422423229@qq.com | ||
* @Date: 27/2/2023 9:07 PM | ||
*/ | ||
@Data | ||
public class WxCpCorpGroupCorpToken implements Serializable { | ||
private static final long serialVersionUID = -8139617060677460515L; | ||
@SerializedName("access_token") | ||
private String accessToken; | ||
@SerializedName("expires_in") | ||
private int expiresIn; | ||
|
||
public static WxCpCorpGroupCorpToken fromJson(String json) { | ||
return WxCpGsonBuilder.create().fromJson(json, WxCpCorpGroupCorpToken.class); | ||
} | ||
|
||
/** | ||
* To json string. | ||
* | ||
* @return the string | ||
*/ | ||
public String toJson() { | ||
return WxCpGsonBuilder.create().toJson(this); | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/corpgroup/WxCpMaTransferSession.java
This file contains 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,47 @@ | ||
package me.chanjar.weixin.cp.bean.corpgroup; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Data; | ||
import me.chanjar.weixin.cp.bean.WxCpAgent; | ||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* @Project: WxJava | ||
* @Package: me.chanjar.weixin.cp.bean.corpgroup | ||
* @Description: 获取下级/下游企业小程序session返回类 | ||
* @Author: libo | ||
* @Email: 422423229@qq.com | ||
* @Date: 27/2/2023 9:10 PM | ||
*/ | ||
@Data | ||
public class WxCpMaTransferSession implements Serializable { | ||
|
||
private static final long serialVersionUID = 4189407986285166516L; | ||
@SerializedName("userid") | ||
private String userId; | ||
@SerializedName("session_key") | ||
private String sessionKey; | ||
|
||
|
||
/** | ||
* From json WxCpMaTransferSession. | ||
* | ||
* @param json the json | ||
* @return the WxCpMaTransferSession | ||
*/ | ||
public static WxCpMaTransferSession fromJson(String json) { | ||
return WxCpGsonBuilder.create().fromJson(json, WxCpMaTransferSession.class); | ||
} | ||
|
||
/** | ||
* To json string. | ||
* | ||
* @return the string | ||
*/ | ||
public String toJson() { | ||
return WxCpGsonBuilder.create().toJson(this); | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
...n-java-cp/src/main/java/me/chanjar/weixin/cp/bean/linkedcorp/WxCpLinkedCorpAgentPerm.java
This file contains 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,23 @@ | ||
package me.chanjar.weixin.cp.bean.linkedcorp; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Data; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* @Project: WxJava | ||
* @Package: me.chanjar.weixin.cp.bean.linkedcorp | ||
* @Description: 获取应用可见范围请求类 | ||
* @Author: libo | ||
* @Email: 422423229@qq.com | ||
* @Date: 28/2/2023 6:16 PM | ||
*/ | ||
@Data | ||
public class WxCpLinkedCorpAgentPerm implements Serializable { | ||
private static final long serialVersionUID = 6794613362541093845L; | ||
@SerializedName("userids") | ||
private String[] userIdList; | ||
@SerializedName("department_ids") | ||
private String[] departmentIdList; | ||
} |
33 changes: 33 additions & 0 deletions
33
...-java-cp/src/main/java/me/chanjar/weixin/cp/bean/linkedcorp/WxCpLinkedCorpDepartment.java
This file contains 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,33 @@ | ||
package me.chanjar.weixin.cp.bean.linkedcorp; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.Accessors; | ||
|
||
import java.io.Serializable; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* @Project: WxJava | ||
* @Package: me.chanjar.weixin.cp.bean.linkedcorp | ||
* @Description: 获取互联企业部门列表 | ||
* @Author: libo | ||
* @Email: 422423229@qq.com | ||
* @Date: 28/2/2023 6:16 PM | ||
*/ | ||
@Data | ||
public class WxCpLinkedCorpDepartment implements Serializable { | ||
private static final long serialVersionUID = -210249269343292440L; | ||
@SerializedName("department_id") | ||
private String departmentId; | ||
@SerializedName("department_name") | ||
private String departmentName; | ||
@SerializedName("parentid") | ||
private String parentId; | ||
@SerializedName("order") | ||
private Integer order; | ||
} |
Oops, something went wrong.