Skip to content

Commit

Permalink
🆕 #2213【企业微信】 增加获取企业所有打卡规则的接口
Browse files Browse the repository at this point in the history
  • Loading branch information
longliveh authored Jul 22, 2021
1 parent e53733b commit 497a0b7
Show file tree
Hide file tree
Showing 5 changed files with 843 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ List<WxCpCheckinData> getCheckinData(Integer openCheckinDataType, Date startTime
*/
List<WxCpCheckinOption> getCheckinOption(Date datetime, List<String> userIdList) throws WxErrorException;


/**
* <pre>
* 获取企业所有打卡规则
* API doc : https://work.weixin.qq.com/api/doc/90000/90135/93384
* </pre>
*
* @return 打卡规则列表
* @throws WxErrorException the wx error exception
*/
List<WxCpCropCheckinOption> getCropCheckinOption() throws WxErrorException;

/**
* <pre>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,22 @@ public List<WxCpCheckinOption> getCheckinOption(Date datetime, List<String> user
);
}

@Override
public List<WxCpCropCheckinOption> getCropCheckinOption() throws WxErrorException {

JsonObject jsonObject = new JsonObject();
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CORP_CHECKIN_OPTION);
String responseContent = this.mainService.post(url, jsonObject.toString());
JsonObject tmpJson = GsonParser.parse(responseContent);

return WxCpGsonBuilder.create()
.fromJson(
tmpJson.get("group"),
new TypeToken<List<WxCpCropCheckinOption>>() {
}.getType()
);
}

@Override
public WxCpApprovalInfo getApprovalInfo(@NonNull Date startTime, @NonNull Date endTime,
Integer cursor, Integer size, List<WxCpApprovalInfoQueryFilter> filters) throws WxErrorException {
Expand Down
Loading

0 comments on commit 497a0b7

Please sign in to comment.