tjx
4 天以前 82298366f5c870afe3db93878470b94cd615667e
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");