tjx
4 天以前 82298366f5c870afe3db93878470b94cd615667e
整合钉钉和企业微信
已修改1个文件
28 ■■■■ 文件已修改
src/main/java/com/gs/dingtalk/service/SimpleExample.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gs/dingtalk/service/SimpleExample.java
@@ -208,20 +208,20 @@
    }
    //    public OapiV2UserGetbymobileResponse getOapiV2UserGetbymobileResponse(SendDingtalk s, String accessToken) {
//        DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/getbymobile");
//        OapiV2UserGetbymobileRequest req = new OapiV2UserGetbymobileRequest();
//        req.setMobile(s.getTelephone());
//        req.setSupportExclusiveAccountSearch(true);
//        OapiV2UserGetbymobileResponse rsp = null;
//
//        try {
//            rsp = client.execute(req, accessToken);
//        } catch (ApiException e) {
//            throw new RuntimeException(e);
//        }
//        return rsp;
//    }
        public OapiV2UserGetbymobileResponse getOapiV2UserGetbymobileResponse(SendDingtalk s, String accessToken) {
        DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/getbymobile");
        OapiV2UserGetbymobileRequest req = new OapiV2UserGetbymobileRequest();
        req.setMobile(s.getTelephone());
        req.setSupportExclusiveAccountSearch(true);
        OapiV2UserGetbymobileResponse rsp = null;
        try {
            rsp = client.execute(req, accessToken);
        } catch (ApiException e) {
            throw new RuntimeException(e);
        }
        return rsp;
    }
    public OapiV2UserGetbymobileResponse getOapiV2UserGetbymobileResponse(String mobile, String accessToken) {
        DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/getbymobile");