Skip to content
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

🆕 【企业微信】 新增获取企业所有打卡规则接口 #2213

Merged
merged 4 commits into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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