8000 :new: #2213【企业微信】 增加获取企业所有打卡规则的接口 · RefinedMe/WxJava@497a0b7 · GitHub
[go: up one dir, main page]

Skip to content < 8000 react-partial partial-name="keyboard-shortcuts-dialog" data-ssr="false" data-attempted-ssr="false" data-react-profiling="false" >

Commit 497a0b7

Browse files
authored
🆕 binarywang#2213【企业微信】 增加获取企业所有打卡规则的接口
1 parent e53733b commit 497a0b7

File tree

5 files changed

+843
-1
lines changed

5 files changed

+843
-1
lines changed

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaService.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ List<WxCpCheckinData> getCheckinData(Integer openCheckinDataType, Date startTime
6060
*/
6161
List<WxCpCheckinOption> getCheckinOption(Date datetime, List<String> userIdList) throws WxErrorException;
6262

63+
64+
/**
65+
* <pre>
66+
* 获取企业所有打卡规则
67+
* API doc : https://work.weixin.qq.com/api/doc/90000/90135/93384
68+
* </pre>
69+
*
70+
* @return 打卡规则列表
71+
* @throws WxErrorException the wx error exception
72+
*/
73+
List<WxCpCropCheckinOption> getCropCheckinOption() throws WxErrorException;
74+
6375
/**
6476
* <pre>
6577
*

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImpl.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,22 @@ public List<WxCpCheckinOption> getCheckinOption(Date datetime, List<String> user
112112
);
113113
}
114114

115+
@Override
116+
public List<WxCpCropCheckinOption> getCropCheckinOption() throws WxErrorException {
117+
118+
JsonObject jsonObject = new JsonObject();
119+
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CORP_CHECKIN_OPTION);
120+
String responseContent = this.mainService.post(url, jsonObject.toString());
121+
JsonObject tmpJson = GsonParser.parse(responseContent);
122+
123+
return WxCpGsonBuilder.create()
124+
.fromJson(
125+
tmpJson.get("group"),
126+
new TypeToken<List<WxCpCropCheckinOption>>() {
127+
}.getType()
128+
);
129+
}
130+
115131
@Override
116132
public WxCpApprovalInfo getApprovalInfo(@NonNull Date startTime, @NonNull Date endTime,
117133
Integer cursor, Integer size, List<WxCpApprovalInfoQueryFilter> filters) throws WxErrorException {

0 commit comments

Comments
 (0)
0