24282 преди 2 години
родител
ревизия
3e5de23ec1
променени са 1 файла, в които са добавени 8 реда и са изтрити 0 реда
  1. 8 0
      hx-dingding/src/main/java/com/fjhx/dingding/utils/DingUtil.java

+ 8 - 0
hx-dingding/src/main/java/com/fjhx/dingding/utils/DingUtil.java

@@ -58,6 +58,10 @@ public class DingUtil {
 
         SuiteTicketInfo suiteTicketInfo = suiteTicketInfoService.getOne(q -> q.eq(SuiteTicketInfo::getCorpId, corpId));
 
+        if (suiteTicketInfo == null){
+            throw new ServiceException("没有找到对应的corp_id");
+        }
+
         GetCorpAccessTokenRequest getCorpAccessTokenRequest = new GetCorpAccessTokenRequest()
                 .setSuiteKey(Constant.SUITE_KEY)
                 .setSuiteSecret(Constant.SUITE_SECRET)
@@ -124,6 +128,10 @@ public class DingUtil {
         }
     }
 
+    public static void main(String[] args) {
+        List<OapiV2DepartmentListsubResponse.DeptBaseResponse> deptList = getDeptList("", 1L);
+        System.out.println(deptList);
+    }
 
     private static com.aliyun.dingtalkcontact_1_0.Client getClient1() throws Exception {
         Config config = new Config();