Parcourir la source

Merge remote-tracking branch 'origin/master'

yumeng il y a 5 ans
Parent
commit
5de77fec79
36 fichiers modifiés avec 1020 ajouts et 507 suppressions
  1. 0 101
      feishu-sdk/pom.xml
  2. 0 18
      feishu-sdk/src/main/java/cn/feishu/sdk/Test.java
  3. 0 61
      feishu-sdk/src/main/java/cn/feishu/sdk/provider/AuthProvider.java
  4. 0 167
      feishu-sdk/src/main/java/cn/feishu/sdk/util/HttpUtil.java
  5. 0 62
      feishu-sdk/src/main/java/cn/feishu/sdk/util/PropertiesUtils.java
  6. 0 4
      feishu-sdk/src/main/resources/config.properties
  7. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  8. 0 7
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java
  9. 241 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CorpFeishuUserController.java
  10. 72 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/CorpFeishuUser.java
  11. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/CorpFeishuUserMapper.java
  12. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/CorpFeishuUserMapper.xml
  13. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/ICorpFeishuUserService.java
  14. 18 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CorpFeishuUserServiceImpl.java
  15. 1 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java
  16. 92 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java
  17. 1 1
      jeecg-boot-module-system/src/main/resources/application-prod.yml
  18. 3 3
      jeecg-boot-module-system/src/main/resources/application-wps.yml
  19. 99 49
      module-callback/pom.xml
  20. 23 0
      module-callback/src/main/java/cn/com/ctop/callback/StartApplication.java
  21. 29 0
      module-callback/src/main/java/cn/com/ctop/callback/config/XxlMqConf.java
  22. 28 0
      module-callback/src/main/java/cn/com/ctop/callback/controller/CallbackController.java
  23. 0 13
      module-callback/src/main/java/org/jeecgframework/boot/App.java
  24. 13 0
      module-callback/src/main/resources/application-dev.yml
  25. 13 0
      module-callback/src/main/resources/application-prod.yml
  26. 13 0
      module-callback/src/main/resources/application-test.yml
  27. 8 0
      module-callback/src/main/resources/application.yml
  28. 29 0
      module-callback/src/main/resources/logback-dev.xml
  29. 29 0
      module-callback/src/main/resources/logback-prod.xml
  30. 29 0
      module-callback/src/main/resources/logback-test.xml
  31. 143 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils.java
  32. 3 5
      module-common/src/main/java/cn/com/ctop/common/module/utils/PropertiesUtils.java
  33. 7 6
      feishu-sdk/src/main/java/cn/feishu/sdk/common/ApiConstant.java
  34. 87 0
      module-common/src/main/java/cn/com/feishu/provider/AuthProvider.java
  35. 5 6
      feishu-sdk/src/main/java/cn/feishu/sdk/provider/MessageProvider.java
  36. 0 1
      pom.xml

+ 0 - 101
feishu-sdk/pom.xml

@@ -1,101 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <groupId>cn.feishu.sdk</groupId>
-  <artifactId>feishu-sdk</artifactId>
-  <version>2.0.2</version>
-
-  <name>feishu-sdk</name>
-  <!-- FIXME change it to the project's website -->
-  <url>http://www.example.com</url>
-
-  <properties>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
-  </properties>
-
-  <dependencies>
-    <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
-      <version>2.6</version>
-    </dependency>
-    <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-      <version>2.6</version>
-    </dependency>
-   <!-- <dependency>
-      <groupId>org.projectlombok</groupId>
-      <artifactId>lombok</artifactId>
-    </dependency>-->
-    <dependency>
-      <groupId>com.alibaba</groupId>
-      <artifactId>fastjson</artifactId>
-      <version>1.2.56</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.httpcomponents</groupId>
-      <artifactId>httpclient</artifactId>
-      <version>4.5.9</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.httpcomponents</groupId>
-      <artifactId>httpcore</artifactId>
-      <version>4.4</version>
-    </dependency>
-    <dependency>
-      <groupId>cn.hutool</groupId>
-      <artifactId>hutool-all</artifactId>
-      <version>4.5.11</version>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
-      <plugins>
-        <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
-        <plugin>
-          <artifactId>maven-clean-plugin</artifactId>
-          <version>3.1.0</version>
-        </plugin>
-        <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
-        <plugin>
-          <artifactId>maven-resources-plugin</artifactId>
-          <version>3.0.2</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-compiler-plugin</artifactId>
-          <version>3.8.0</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-surefire-plugin</artifactId>
-          <version>2.22.1</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-jar-plugin</artifactId>
-          <version>3.0.2</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-install-plugin</artifactId>
-          <version>2.5.2</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-deploy-plugin</artifactId>
-          <version>2.8.2</version>
-        </plugin>
-        <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
-        <plugin>
-          <artifactId>maven-site-plugin</artifactId>
-          <version>3.7.1</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-project-info-reports-plugin</artifactId>
-          <version>3.0.0</version>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-  </build>
-</project>

+ 0 - 18
feishu-sdk/src/main/java/cn/feishu/sdk/Test.java

@@ -1,18 +0,0 @@
-package cn.feishu.sdk;
-
-import cn.feishu.sdk.provider.AuthProvider;
-
-import java.io.UnsupportedEncodingException;
-
-public class Test {
-    public static void main(String[] args){
-        AuthProvider authProvider = new AuthProvider();
-        try {
-//            authProvider.getAuthUrl("state");
-            authProvider.getAppAccessToken();
-            authProvider.getTenantAccessToken();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-}

+ 0 - 61
feishu-sdk/src/main/java/cn/feishu/sdk/provider/AuthProvider.java

@@ -1,61 +0,0 @@
-package cn.feishu.sdk.provider;
-
-import cn.feishu.sdk.common.ApiConstant;
-import cn.feishu.sdk.util.HttpUtil;
-import cn.feishu.sdk.util.PropertiesUtils;
-import com.alibaba.fastjson.JSONObject;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URLEncoder;
-
-public class AuthProvider {
-    public String getAuthUrl(String state) throws UnsupportedEncodingException, MalformedURLException {
-        String redirectUri = PropertiesUtils.getConfig("callback_url");
-        return HttpUtil.feishuGetRequestString(ApiConstant.FEISHU_API_URL+ApiConstant.AUTH_INDEX+"?redirect_uri="+ URLEncoder.encode(redirectUri,"UTF-8")+"&app_id="+ApiConstant.FEISHU_APP_ID+"&state="+state);
-    }
-    public JSONObject getAccessToken(String code) throws Exception {
-        JSONObject params = new JSONObject();
-        params.put("app_access_token",getAppAccessToken());
-        params.put("grant_type","authorization_code");
-        params.put("code",code);
-        return HttpUtil.feishuPostRequest(ApiConstant.FEISHU_API_URL+ApiConstant.AUTH_ACCESS_TOKEN,params);
-    }
-
-    public JSONObject refreshAccessToken(String refreshToken) throws Exception{
-        JSONObject params = new JSONObject();
-        params.put("app_access_token",getAppAccessToken());
-        params.put("grant_type","refresh_token");
-        params.put("refresh_token",refreshToken);
-        return HttpUtil.feishuPostRequest(ApiConstant.FEISHU_API_URL+ApiConstant.REFRESH_AUTH_ACCESS_TOKEN,params);
-    }
-
-    public JSONObject getUserInfo(String accessToken){
-        JSONObject params = new JSONObject();
-        params.put("user_access_token",accessToken);
-        return HttpUtil.feishuGetRequest("Bearer user_access_token",ApiConstant.FEISHU_API_URL+ApiConstant.USER_INFO,params);
-    }
-
-    public String getAppAccessToken() throws Exception {
-        JSONObject params = new JSONObject();
-        params.put("app_id",ApiConstant.FEISHU_APP_ID);
-        params.put("app_secret",ApiConstant.FEISHU_APP_SECRET);
-        JSONObject resultNode = HttpUtil.feishuPostRequest(ApiConstant.FEISHU_API_URL+ApiConstant.APP_ACCESS_TOKEN,params);
-        if (resultNode.getIntValue("code")==0){
-            return resultNode.getString("app_access_token");
-        }else {
-            throw new Exception();
-        }
-    }
-
-    public String getTenantAccessToken() throws Exception {
-        JSONObject params = new JSONObject();
-        params.put("app_id",ApiConstant.FEISHU_APP_ID);
-        params.put("app_secret",ApiConstant.FEISHU_APP_SECRET);
-        JSONObject resultNode = HttpUtil.feishuPostRequest(ApiConstant.FEISHU_API_URL+ApiConstant.TENANT_ACCESS_TOKEN,params);
-        if (resultNode.getIntValue("code")==0){
-            return resultNode.getString("tenant_access_token");
-        }else {
-            throw new Exception();
-        }
-    }
-}

+ 0 - 167
feishu-sdk/src/main/java/cn/feishu/sdk/util/HttpUtil.java

@@ -1,167 +0,0 @@
-package cn.feishu.sdk.util;
-
-import cn.hutool.extra.ssh.JschRuntimeException;
-import com.alibaba.fastjson.JSONObject;
-import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.ContentType;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClientBuilder;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URI;
-
-public class HttpUtil {
-
-    public static JSONObject feishuGetRequest(String url, JSONObject params){
-        return HttpUtil.feishuGetRequest(null,url,params);
-    }
-    public static JSONObject feishuPostRequest(String url,JSONObject params){
-        return HttpUtil.feishuPostRequest(null,url,params);
-    }
-
-    public static String feishuGetRequestString(String url) {
-        System.out.println(url);
-        // 构造请求
-        HttpEntityEnclosingRequestBase httpEntity = new HttpEntityEnclosingRequestBase() {
-            @Override
-            public String getMethod() {
-                return "GET";
-            }
-        };
-        CloseableHttpResponse response = null;
-        CloseableHttpClient client = null;
-        try {
-            client = HttpClientBuilder.create().build();
-            httpEntity.setURI(URI.create(url));
-            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
-            httpEntity.setConfig(requestConfig);
-            response = client.execute(httpEntity);
-            if (response != null && response.getStatusLine().getStatusCode() == 200) {
-                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-                StringBuilder result = new StringBuilder();
-                String line = "";
-                while ((line = bufferedReader.readLine()) != null) {
-                    result.append(line);
-                }
-                bufferedReader.close();
-                System.out.println(result.toString());
-                return result.toString();
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if (response != null) {
-                    response.close();
-                }
-                if (client != null) {
-                    client.close();
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        return null;
-    }
-
-    public static JSONObject feishuGetRequest(String accessToken, String url, JSONObject params) {
-        System.out.println(url);
-        // 构造请求
-        HttpEntityEnclosingRequestBase httpEntity = new HttpEntityEnclosingRequestBase() {
-            @Override
-            public String getMethod() {
-                return "GET";
-            }
-        };
-        if(accessToken != null){
-            httpEntity.setHeader("Authorization", accessToken);
-        }
-        CloseableHttpResponse response = null;
-        CloseableHttpClient client = null;
-        try {
-            client = HttpClientBuilder.create().build();
-            httpEntity.setURI(URI.create(url));
-            if (params != null){
-                httpEntity.setEntity(new StringEntity(params.toJSONString(), ContentType.APPLICATION_JSON));
-            }
-            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
-            httpEntity.setConfig(requestConfig);
-            response = client.execute(httpEntity);
-            if (response != null && response.getStatusLine().getStatusCode() == 200) {
-                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-                StringBuilder result = new StringBuilder();
-                String line = "";
-                while ((line = bufferedReader.readLine()) != null) {
-                    result.append(line);
-                }
-                bufferedReader.close();
-                System.out.println(result.toString());
-                return JSONObject.parseObject(result.toString());
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if (response != null) {
-                    response.close();
-                }
-                if (client != null) {
-                    client.close();
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        return null;
-    }
-
-
-
-    public static JSONObject feishuPostRequest(String accessToken, String url, JSONObject params) {
-        // 构造请求
-        HttpPost httpEntity = new HttpPost(url);
-        if(accessToken != null){
-            httpEntity.setHeader("Authorization", accessToken);
-        }
-        CloseableHttpResponse response = null;
-        CloseableHttpClient client = null;
-        try {
-            client = HttpClientBuilder.create().build();
-            httpEntity.setEntity(new StringEntity(params.toJSONString(), ContentType.APPLICATION_JSON));
-            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
-            httpEntity.setConfig(requestConfig);
-            response = client.execute(httpEntity);
-            if (response != null && response.getStatusLine().getStatusCode() == 200) {
-                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-                StringBuilder result = new StringBuilder();
-                String line = "";
-                while ((line = bufferedReader.readLine()) != null) {
-                    result.append(line);
-                }
-                bufferedReader.close();
-                System.out.println(result.toString());
-                return JSONObject.parseObject(result.toString());
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if (response != null) {
-                    response.close();
-                }
-                if (client != null) {
-                    client.close();
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        return null;
-    }
-}

+ 0 - 62
feishu-sdk/src/main/java/cn/feishu/sdk/util/PropertiesUtils.java

@@ -1,62 +0,0 @@
-package cn.feishu.sdk.util;
-
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * @author jeecg-boot
- * 2019年11月12日10:04:00
- */
-public class PropertiesUtils {
-    private static Map<String, String> cache = new HashMap<String, String>();
-
-    public static String getConfig(String key) {
-        return getValue("config", key);
-    }
-
-    public static String getValue(String name, String key) {
-        try {
-            String cacheValue = (String) cache.get(name + key);
-            if (cacheValue != null) {
-                return cacheValue;
-            }
-            Properties props = new Properties();
-            InputStream in = PropertiesUtils.class.getResourceAsStream("/"
-                    + name + ".properties");
-            props.load(in);
-            String value = props.getProperty(key);
-            cache.put(name + key, value);
-            props.clone();
-            in.close();
-            return value;
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    public static Map<String, String> getMap(String name) {
-        try {
-            Properties props = new Properties();
-            InputStream in = PropertiesUtils.class.getResourceAsStream("/"
-                    + name + ".properties");
-            props.load(in);
-            Iterator<Object> it = props.keySet().iterator();
-            Map<String, String> map = new HashMap<String, String>();
-            while (it.hasNext()) {
-                String key = it.next().toString();
-                String value = props.getProperty(key);
-                map.put(key, value);
-            }
-            props.clone();
-            in.close();
-            return map;
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-}

+ 0 - 4
feishu-sdk/src/main/resources/config.properties

@@ -1,4 +0,0 @@
-feishu_api_url=https://open.feishu.cn/open-apis
-feishu_app_id=cli_9e68af69ca34d00e
-feishu_app_secret=0RsCBRCLx1rG8HKfeZNeAbddxZ3Rsnwv
-callback_url=https://callback.tjyourong.com.cn/jeecg-boot/feishu/auth

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -131,6 +131,7 @@ public class ShiroConfig {
 
         filterChainDefinitionMap.put("/system/userCompany/**", "anon");
         filterChainDefinitionMap.put("/qywexin", "anon");
+        filterChainDefinitionMap.put("/sys/feishu/**", "anon");
         filterChainDefinitionMap.put("/test/getGroupData/**", "anon");
         filterChainDefinitionMap.put("/test/getVideoAndImage/**", "anon");
         filterChainDefinitionMap.put("/test/gerCreative/**", "anon");

+ 0 - 7
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java

@@ -62,13 +62,6 @@ public class CallbackController {
     @Autowired
     private IReportService reportService;
 
-    @GetMapping("/feishu/auth")
-    public void feishuAuth(HttpServletRequest request,
-                        HttpServletResponse response,
-                        @RequestParam("code") String code,
-                        @RequestParam("state") String state) throws IOException {
-        System.out.println(request.getQueryString());
-    }
     @GetMapping("/qywexin")
     public void qywexin(HttpServletRequest request,
                         HttpServletResponse response,

+ 241 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CorpFeishuUserController.java

@@ -0,0 +1,241 @@
+package org.jeecg.modules.ctop.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.ctop.entity.CorpFeishuUser;
+import org.jeecg.modules.ctop.service.ICorpFeishuUserService;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+ /**
+ * 飞书用户信息
+ * @author jeecg-boot
+ * @date   2020-06-23
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="飞书用户信息")
+@RestController
+@RequestMapping("/ctop/corpFeishuUser")
+public class CorpFeishuUserController {
+	@Autowired
+	private ICorpFeishuUserService corpFeishuUserService;
+
+	/**
+	  * 分页列表查询
+	 * @param corpFeishuUser
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "飞书用户信息-分页列表查询")
+	@ApiOperation(value="飞书用户信息-分页列表查询", notes="飞书用户信息-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<CorpFeishuUser>> queryPageList(CorpFeishuUser corpFeishuUser,
+													   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+													   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+													   HttpServletRequest req) {
+		Result<IPage<CorpFeishuUser>> result = new Result<>();
+		QueryWrapper<CorpFeishuUser> queryWrapper = QueryGenerator.initQueryWrapper(corpFeishuUser, req.getParameterMap());
+		Page<CorpFeishuUser> page = new Page<CorpFeishuUser>(pageNo, pageSize);
+		IPage<CorpFeishuUser> pageList = corpFeishuUserService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param corpFeishuUser
+	 * @return
+	 */
+	@AutoLog(value = "飞书用户信息-添加")
+	@ApiOperation(value="飞书用户信息-添加", notes="飞书用户信息-添加")
+	@PostMapping(value = "/add")
+	public Result<CorpFeishuUser> add(@RequestBody CorpFeishuUser corpFeishuUser) {
+		Result<CorpFeishuUser> result = new Result<>();
+		try {
+			corpFeishuUserService.save(corpFeishuUser);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param corpFeishuUser
+	 * @return
+	 */
+	@AutoLog(value = "飞书用户信息-编辑")
+	@ApiOperation(value="飞书用户信息-编辑", notes="飞书用户信息-编辑")
+	@PutMapping(value = "/edit")
+	public Result<CorpFeishuUser> edit(@RequestBody CorpFeishuUser corpFeishuUser) {
+		Result<CorpFeishuUser> result = new Result<>();
+		CorpFeishuUser corpFeishuUserEntity = corpFeishuUserService.getById(corpFeishuUser.getId());
+		if(corpFeishuUserEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = corpFeishuUserService.updateById(corpFeishuUser);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "飞书用户信息-通过id删除")
+	@ApiOperation(value="飞书用户信息-通过id删除", notes="飞书用户信息-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<Object> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			corpFeishuUserService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "飞书用户信息-批量删除")
+	@ApiOperation(value="飞书用户信息-批量删除", notes="飞书用户信息-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<CorpFeishuUser> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<CorpFeishuUser> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.corpFeishuUserService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "飞书用户信息-通过id查询")
+	@ApiOperation(value="飞书用户信息-通过id查询", notes="飞书用户信息-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<CorpFeishuUser> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<CorpFeishuUser> result = new Result<>();
+		CorpFeishuUser corpFeishuUser = corpFeishuUserService.getById(id);
+		if(corpFeishuUser==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(corpFeishuUser);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<CorpFeishuUser> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              CorpFeishuUser corpFeishuUser = JSON.parseObject(deString, CorpFeishuUser.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(corpFeishuUser, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<CorpFeishuUser> pageList = corpFeishuUserService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "飞书用户信息列表");
+      mv.addObject(NormalExcelConstants.CLASS, CorpFeishuUser.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("飞书用户信息列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<CorpFeishuUser> listCorpFeishuUsers = ExcelImportUtil.importExcel(file.getInputStream(), CorpFeishuUser.class, params);
+              corpFeishuUserService.saveBatch(listCorpFeishuUsers);
+              return Result.ok("文件导入成功!数据行数:" + listCorpFeishuUsers.size());
+          } catch (Exception e) {
+              log.error(e.getMessage(),e);
+              return Result.error("文件导入失败:"+e.getMessage());
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 72 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/CorpFeishuUser.java

@@ -0,0 +1,72 @@
+package org.jeecg.modules.ctop.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 飞书用户信息
+ * @author jeecg-boot
+ * @date   2020-06-23
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_corp_feishu_user")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_corp_feishu_user对象", description="飞书用户信息")
+public class CorpFeishuUser {
+
+	/**id*/
+	@TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+	private Long id;
+	/**email*/
+	@Excel(name = "email", width = 15)
+    @ApiModelProperty(value = "email")
+	private String email;
+	/**name*/
+	@Excel(name = "name", width = 15)
+    @ApiModelProperty(value = "name")
+	private String name;
+
+	private String openId;
+	/**avatarUrl*/
+	@Excel(name = "avatarUrl", width = 15)
+    @ApiModelProperty(value = "avatarUrl")
+	private String avatarUrl;
+	/**avatarThumb*/
+	@Excel(name = "avatarThumb", width = 15)
+    @ApiModelProperty(value = "avatarThumb")
+	private String avatarThumb;
+	/**avatarMiddle*/
+	@Excel(name = "avatarMiddle", width = 15)
+    @ApiModelProperty(value = "avatarMiddle")
+	private String avatarMiddle;
+	/**avatarBig*/
+	@Excel(name = "avatarBig", width = 15)
+    @ApiModelProperty(value = "avatarBig")
+	private String avatarBig;
+	/**userId*/
+	@Excel(name = "userId", width = 15)
+    @ApiModelProperty(value = "userId")
+	private String userId;
+	/**mobile*/
+	@Excel(name = "mobile", width = 15)
+    @ApiModelProperty(value = "mobile")
+	private String mobile;
+	/**createTime*/
+    @ApiModelProperty(value = "createTime")
+	private Date createTime;
+	/**updateTime*/
+    @ApiModelProperty(value = "updateTime")
+	private Date updateTime;
+}

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/CorpFeishuUserMapper.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.ctop.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.ctop.entity.CorpFeishuUser;
+
+/**
+ * 飞书用户信息
+ * @author: jeecg-boot
+ * @date:   2020-06-23
+ * @cersion: V1.0
+ */
+public interface CorpFeishuUserMapper extends BaseMapper<CorpFeishuUser> {
+
+}

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/CorpFeishuUserMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.ctop.mapper.CorpFeishuUserMapper">
+
+</mapper>

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/ICorpFeishuUserService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.ctop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.ctop.entity.CorpFeishuUser;
+
+/**
+ * 飞书用户信息
+ * @author jeecg-boot
+ * @date   2020-06-23
+ * @version V1.0
+ */
+public interface ICorpFeishuUserService extends IService<CorpFeishuUser> {
+
+}

+ 18 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CorpFeishuUserServiceImpl.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.ctop.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.ctop.entity.CorpFeishuUser;
+import org.jeecg.modules.ctop.mapper.CorpFeishuUserMapper;
+import org.jeecg.modules.ctop.service.ICorpFeishuUserService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 飞书用户信息
+ * @author jeecg-boot
+ * @date   2020-06-23
+ * @version V1.0
+ */
+@Service
+public class CorpFeishuUserServiceImpl extends ServiceImpl<CorpFeishuUserMapper, CorpFeishuUser> implements ICorpFeishuUserService {
+
+}

+ 1 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java

@@ -5,7 +5,6 @@ import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.service.ISysRoleService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.common.module.utils.SpringUtils;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.apache.shiro.SecurityUtils;
@@ -16,7 +15,6 @@ import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.jeecg.modules.system.entity.SysUser;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
@@ -72,6 +70,7 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
     }
 
     //视频报表
+    @Override
     public List<ProjectMember> getProjects(List<Integer> mediaIds) {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String userId = sysUser.getId();

+ 92 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java

@@ -4,6 +4,9 @@ import cn.com.ctop.common.module.entity.CtopCorpWexinUser;
 import cn.com.ctop.common.module.service.ICtopCorpWexinUserService;
 import cn.com.ctop.common.module.utils.AesEncryptUtil;
 import cn.com.ctop.common.module.utils.EncryptedString;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import cn.com.feishu.provider.AuthProvider;
 import cn.hutool.core.util.RandomUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.aliyuncs.exceptions.ClientException;
@@ -21,6 +24,7 @@ import me.chanjar.weixin.cp.bean.WxCpUser;
 import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
 import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.subject.Subject;
+import org.eclipse.jetty.util.UrlEncoded;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.system.api.ISysBaseApi;
@@ -30,6 +34,8 @@ import org.jeecg.common.util.DySmsHelper;
 import org.jeecg.common.util.PasswordUtil;
 import org.jeecg.common.util.RedisUtil;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.ctop.entity.CorpFeishuUser;
+import org.jeecg.modules.ctop.service.ICorpFeishuUserService;
 import org.jeecg.modules.shiro.vo.DefContants;
 import org.jeecg.modules.system.entity.SysDepart;
 import org.jeecg.modules.system.entity.SysUser;
@@ -42,6 +48,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.util.*;
 
 /**
@@ -53,6 +60,7 @@ import java.util.*;
 @Api(tags = "用户登录")
 @Slf4j
 public class LoginController {
+    private static final String DOMAIN_SERVER = "http://adsp.tjyourong.com.cn/";
     @Autowired
     private ISysUserService sysUserService;
     @Autowired
@@ -65,11 +73,94 @@ public class LoginController {
     private ISysDepartService sysDepartService;
     @Autowired
     private ICtopCorpWexinUserService ctopCorpWexinUserService;
+    @Autowired
+    private ICorpFeishuUserService corpFeishuUserService;
+    @GetMapping("feishu/url")
+    public Map<String,Object> getUrl(){
+        Map<String,Object>result = new HashMap<>();
+        try {
+            String url = AuthProvider.getAuthUrl("");
+            result.put("url",url);
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+            return result;
+        } catch (Exception e) {
+            e.printStackTrace();
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_SERVER_ERROR);
+            return result;
+        }
+    }
+    @GetMapping("/feishu/auth")
+    public void feishuAuth(HttpServletRequest request,
+                           HttpServletResponse response,
+                           @RequestParam(name = "code",defaultValue = "code") String code,
+                           @RequestParam(name = "state",defaultValue = "_t") String state) throws IOException {
+        Result<JSONObject> result = new Result<>();
+        //1:根据code值获取用户飞书信息
+        try {
+            if(code.trim().equals("code")){
+                String url = AuthProvider.getAuthUrl("");
+                response.sendRedirect(url);
+                return ;
+            }
+            JSONObject data = AuthProvider.getFeishuUserInfo(code);
+            String accessToken = data.getJSONObject("data").getString("access_token");
+            String openId = data.getJSONObject("data").getString("open_id");
+            //根据accessToken
+            JSONObject userData = AuthProvider.getUserInfo(accessToken);
+            JSONObject dataObject = userData.getJSONObject("data");
+            String email = dataObject.getString("email");
+            if(null == email||email.trim().equals("")){
+                response.sendRedirect(DOMAIN_SERVER+"errorPage?desc="+ UrlEncoded.encodeString("飞书账号未绑定邮箱"));
+                return ;
+            }
+            SysUser sysUser = sysUserService.getUserByEmail(email);
+            if (sysUser == null) {
+                response.sendRedirect(DOMAIN_SERVER+"errorPage?desc="+ UrlEncoded.encodeString("该用户未注册系统账户,请联系管理员"));
+                return ;
+            }
+            if(sysUser.getStatus() != 1){
+                response.sendRedirect(DOMAIN_SERVER+"errorPage?desc="+UrlEncoded.encodeString("该用户已被冻结,请联系管理员"));
+                return ;
+            }
+            String departId = sysDepartService.selectIdByOrdCode(sysUser.getOrgCode());
+            sysUser.setDepartId(departId);
+            result = sysUserService.checkUserIsEffective(sysUser);
+            if (!result.isSuccess()) {
+                response.sendRedirect(DOMAIN_SERVER+"errorPage?desc="+UrlEncoded.encodeString(result.getMessage()));
+                return ;
+            }
+            //用户登录信息
+            userInfo(sysUser, result);
+            sysBaseApi.addLog("用户名: " + email + ",登录成功!", CommonConstant.LOG_TYPE_1, null);
+            CorpFeishuUser feishuUser = corpFeishuUserService.getById(sysUser.getId());
+            if (feishuUser == null) {
+                feishuUser = new CorpFeishuUser();
+                feishuUser.setOpenId(openId);
+                feishuUser.setUserId(sysUser.getId());
+                feishuUser.setEmail(sysUser.getEmail());
+                feishuUser.setAvatarBig(dataObject.getString("avatar_big"));
+                feishuUser.setAvatarMiddle(dataObject.getString("avatar_middle"));
+                feishuUser.setAvatarThumb(dataObject.getString("avatar_thumb"));
+                feishuUser.setAvatarUrl(dataObject.getString("avatar_url"));
+                feishuUser.setName(dataObject.getString("name"));
+                feishuUser.setMobile(dataObject.getString("mobile"));
+                feishuUser.setCreateTime(new Date());
+                feishuUser.setUpdateTime(new Date());
+                corpFeishuUserService.save(feishuUser);
+            }
+            response.sendRedirect(DOMAIN_SERVER+"dashboard/analysis");
+            return ;
+        } catch (Exception e) {
+            e.printStackTrace();
+            response.sendRedirect(DOMAIN_SERVER+"errorPage?desc="+ UrlEncoded.encodeString("系统异常,请联系管理员"));
+            return;
+        }
+    }
 
     @RequestMapping(value = "/wxlogin", method = RequestMethod.POST)
     @ApiOperation("企业微信登录接口")
     public Result<JSONObject> wxlogin(@RequestParam(name = "code") String code) throws Exception {
-        Result<JSONObject> result = new Result<JSONObject>();
+        Result<JSONObject> result = new Result<>();
         val configStorage = new WxCpDefaultConfigImpl();
         configStorage.setCorpId("ww24b8a47826f5875f");
         configStorage.setAgentId(1000002);

+ 1 - 1
jeecg-boot-module-system/src/main/resources/application-prod.yml

@@ -118,7 +118,7 @@ spring:
         max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
         min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
       shutdown-timeout: 100ms
-    password: ''
+    password: foobared
     port: 6379
 #mybatis plus 设置
 mybatis-plus:

+ 3 - 3
jeecg-boot-module-system/src/main/resources/application-wps.yml

@@ -56,7 +56,7 @@ spring:
   autoconfigure:
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
   datasource:
-    url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+    url: jdbc:mysql://139.186.27.96:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
     username: hcst
     password: test@20190531
     driver-class-name: com.mysql.jdbc.Driver
@@ -95,7 +95,7 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://139.186.27.96:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
           username: hcst
           password: test@20190531
           driver-class-name: com.mysql.jdbc.Driver
@@ -108,7 +108,7 @@ spring:
   #redis 配置
   redis:
     database: 0
-    host: 127.0.0.1
+    host: 172.30.0.17
     lettuce:
       pool:
         max-active: 8   #最大连接数据库连接数,设 0 为没有限制

+ 99 - 49
module-callback/pom.xml

@@ -2,10 +2,14 @@
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
-  <groupId>org.jeecgframework.boot</groupId>
+  <groupId>cn.com.ctop</groupId>
   <artifactId>module-callback</artifactId>
   <version>2.0.2</version>
-
+  <parent>
+    <groupId>org.jeecgframework.boot</groupId>
+    <artifactId>jeecg-boot-parent</artifactId>
+    <version>2.0.2</version>
+  </parent>
   <name>module-callback</name>
   <!-- FIXME change it to the project's website -->
   <url>http://www.example.com</url>
@@ -18,56 +22,102 @@
 
   <dependencies>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.11</version>
-      <scope>test</scope>
+      <groupId>cn.com.ctop</groupId>
+      <artifactId>module-common</artifactId>
+      <version>2.0.2</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jcl-over-slf4j</artifactId>
+      <version>1.7.25</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.7.25</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jeecgframework.boot</groupId>
+      <artifactId>jeecg-boot-base-common</artifactId>
+      <version>2.0.2</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jcl-over-slf4j</artifactId>
+      <version>1.7.25</version>
+    </dependency>
+    <dependency>
+      <groupId>com.xuxueli</groupId>
+      <artifactId>xxl-mq-client</artifactId>
+      <version>1.2.2</version>
     </dependency>
   </dependencies>
 
   <build>
-    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
-      <plugins>
-        <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
-        <plugin>
-          <artifactId>maven-clean-plugin</artifactId>
-          <version>3.1.0</version>
-        </plugin>
-        <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
-        <plugin>
-          <artifactId>maven-resources-plugin</artifactId>
-          <version>3.0.2</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-compiler-plugin</artifactId>
-          <version>3.8.0</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-surefire-plugin</artifactId>
-          <version>2.22.1</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-jar-plugin</artifactId>
-          <version>3.0.2</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-install-plugin</artifactId>
-          <version>2.5.2</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-deploy-plugin</artifactId>
-          <version>2.8.2</version>
-        </plugin>
-        <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
-        <plugin>
-          <artifactId>maven-site-plugin</artifactId>
-          <version>3.7.1</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-project-info-reports-plugin</artifactId>
-          <version>3.0.0</version>
-        </plugin>
-      </plugins>
-    </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>org.mybatis.generator</groupId>
+        <artifactId>mybatis-generator-maven-plugin</artifactId>
+        <version>1.3.6</version>
+        <configuration>
+          <!-- 是否覆盖,true表示会替换生成的JAVA文件,false则不覆盖 -->
+          <overwrite>true</overwrite>
+        </configuration>
+        <dependencies>
+          <!--mysql驱动包-->
+          <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>5.1.45</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+      <plugin>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-maven-plugin</artifactId>
+      </plugin>
+    </plugins>
+    <resources>
+      <!-- 解决MyBatis配置文件引入问题 -->
+      <resource>
+        <directory>src/main/java</directory>
+        <includes>
+          <include>**/*.properties</include>
+          <include>**/*.xml</include>
+        </includes>
+        <!-- 是否替换资源中的属性-->
+        <filtering>true</filtering>
+      </resource>
+      <resource>
+        <directory>src/main/resources</directory>
+        <filtering>true</filtering>
+      </resource>
+    </resources>
   </build>
+
+  <profiles>
+    <profile>
+      <id>dev</id>
+      <properties>
+        <!-- 环境标识,需要与配置文件的名称相对应 -->
+        <activatedProperties>dev</activatedProperties>
+      </properties>
+      <activation>
+        <!-- 默认环境 -->
+        <activeByDefault>true</activeByDefault>
+      </activation>
+    </profile>
+    <profile>
+      <id>test</id>
+      <properties>
+        <activatedProperties>test</activatedProperties>
+      </properties>
+    </profile>
+    <profile>
+      <id>prod</id>
+      <properties>
+        <activatedProperties>prod</activatedProperties>
+      </properties>
+    </profile>
+  </profiles>
 </project>

+ 23 - 0
module-callback/src/main/java/cn/com/ctop/callback/StartApplication.java

@@ -0,0 +1,23 @@
+package cn.com.ctop.callback;
+import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
+import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.spring.boot.autoconfigure.ShiroAnnotationProcessorAutoConfiguration;
+import org.apache.shiro.spring.boot.autoconfigure.ShiroAutoConfiguration;
+import org.apache.shiro.spring.boot.autoconfigure.ShiroBeanAutoConfiguration;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+
+
+@Slf4j
+@SpringBootApplication(exclude = {DynamicDataSourceAutoConfiguration.class,DruidDataSourceAutoConfigure.class,DataSourceAutoConfiguration.class,ShiroAnnotationProcessorAutoConfiguration.class, ShiroAutoConfiguration.class, ShiroBeanAutoConfiguration.class})
+@ComponentScan(basePackages = {"cn.com.ctop.callback"})
+@Configuration
+public class StartApplication {
+    public static void main(String[] args){
+        SpringApplication.run(StartApplication.class, args);
+    }
+}

+ 29 - 0
module-callback/src/main/java/cn/com/ctop/callback/config/XxlMqConf.java

@@ -0,0 +1,29 @@
+package cn.com.ctop.callback.config;
+
+import com.xxl.mq.client.factory.impl.XxlMqSpringClientFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Component;
+
+@Component
+public class XxlMqConf {
+
+    // ---------------------- param ----------------------
+
+    @Value("${xxl.mq.admin.address}")
+    private String adminAddress;
+    @Value("${xxl.mq.accessToken}")
+    private String accessToken;
+
+
+    @Bean
+    public XxlMqSpringClientFactory getXxlMqConsumer(){
+
+        XxlMqSpringClientFactory xxlMqSpringClientFactory = new XxlMqSpringClientFactory();
+        xxlMqSpringClientFactory.setAdminAddress(adminAddress);
+        xxlMqSpringClientFactory.setAccessToken(accessToken);
+
+        return xxlMqSpringClientFactory;
+    }
+
+}

+ 28 - 0
module-callback/src/main/java/cn/com/ctop/callback/controller/CallbackController.java

@@ -0,0 +1,28 @@
+package cn.com.ctop.callback.controller;
+
+import com.xxl.mq.client.message.XxlMqMessage;
+import com.xxl.mq.client.producer.XxlMqProducer;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@Controller
+@RequestMapping("/")
+public class CallbackController {
+    @RequestMapping("/{group}/{topic}")
+    @ResponseBody
+    public Result<String> callbackMethod(HttpServletRequest request,
+                                         HttpServletResponse response,
+                                         @PathVariable(name = "group") String group,
+                                         @PathVariable(name = "topic") String topic){
+        Result<String> result = new Result<>();
+        XxlMqProducer.produce(new XxlMqMessage(group+"_"+topic, request.getQueryString()));
+        result.success("success");
+        return result;
+    }
+}

+ 0 - 13
module-callback/src/main/java/org/jeecgframework/boot/App.java

@@ -1,13 +0,0 @@
-package org.jeecgframework.boot;
-
-/**
- * Hello world!
- *
- */
-public class App 
-{
-    public static void main( String[] args )
-    {
-        System.out.println( "Hello World!" );
-    }
-}

+ 13 - 0
module-callback/src/main/resources/application-dev.yml

@@ -0,0 +1,13 @@
+server:
+  port: 8801
+  servlet:
+    context-path: /
+xxl:
+  mq:
+    accessToken:
+    admin:
+      address: http://129.28.150.229:8808/xxl-mq-admin
+logging:
+  level:
+    root: info
+  config: classpath:logback-dev.xml

+ 13 - 0
module-callback/src/main/resources/application-prod.yml

@@ -0,0 +1,13 @@
+server:
+  port: 8801
+  servlet:
+    context-path: /
+xxl:
+  mq:
+    accessToken:
+    admin:
+      address: http://129.28.150.229:8808/xxl-mq-admin
+logging:
+  level:
+    root: info
+  config: classpath:logback-prod.xml

+ 13 - 0
module-callback/src/main/resources/application-test.yml

@@ -0,0 +1,13 @@
+server:
+  port: 8801
+  servlet:
+    context-path: /
+xxl:
+  mq:
+    accessToken:
+    admin:
+      address: http://129.28.150.229:8808/xxl-mq-admin
+logging:
+  level:
+    root: info
+  config: classpath:logback-test.xml

+ 8 - 0
module-callback/src/main/resources/application.yml

@@ -0,0 +1,8 @@
+server:
+  port: 8801
+  context-path: /
+xxl:
+  mq:
+    accessToken:
+    admin:
+      address: http://129.28.150.229:8808/xxl-mq-admin

+ 29 - 0
module-callback/src/main/resources/logback-dev.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration debug="false" scan="true" scanPeriod="1 seconds">
+
+    <contextName>logback</contextName>
+    <property name="log.path" value="/data/applogs/xxl-mq/xxl-mq-samples-springboot.log"/>
+
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d{HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>${log.path}.%d{yyyy-MM-dd}.zip</fileNamePattern>
+        </rollingPolicy>
+        <encoder>
+            <pattern>%date %level [%thread] %logger{36} [%file : %line] %msg%n
+            </pattern>
+        </encoder>
+    </appender>
+
+    <root level="info">
+        <appender-ref ref="console"/>
+        <appender-ref ref="file"/>
+    </root>
+
+</configuration>

+ 29 - 0
module-callback/src/main/resources/logback-prod.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration debug="false" scan="true" scanPeriod="1 seconds">
+
+    <contextName>logback</contextName>
+    <property name="log.path" value="/data/applogs/xxl-mq/xxl-mq-samples-springboot.log"/>
+
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d{HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>${log.path}.%d{yyyy-MM-dd}.zip</fileNamePattern>
+        </rollingPolicy>
+        <encoder>
+            <pattern>%date %level [%thread] %logger{36} [%file : %line] %msg%n
+            </pattern>
+        </encoder>
+    </appender>
+
+    <root level="info">
+        <appender-ref ref="console"/>
+        <appender-ref ref="file"/>
+    </root>
+
+</configuration>

+ 29 - 0
module-callback/src/main/resources/logback-test.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration debug="false" scan="true" scanPeriod="1 seconds">
+
+    <contextName>logback</contextName>
+    <property name="log.path" value="/data/applogs/xxl-mq/xxl-mq-samples-springboot.log"/>
+
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d{HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>${log.path}.%d{yyyy-MM-dd}.zip</fileNamePattern>
+        </rollingPolicy>
+        <encoder>
+            <pattern>%date %level [%thread] %logger{36} [%file : %line] %msg%n
+            </pattern>
+        </encoder>
+    </appender>
+
+    <root level="info">
+        <appender-ref ref="console"/>
+        <appender-ref ref="file"/>
+    </root>
+
+</configuration>

+ 143 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils.java

@@ -863,4 +863,147 @@ public class HttpUtils {
         }
         return strReturn;
     }
+
+    public static JSONObject feishuGetRequest(String url, JSONObject params){
+        return feishuGetRequest(null,url,params);
+    }
+    public static JSONObject feishuPostRequest(String url,JSONObject params){
+        return feishuPostRequest(null,url,params);
+    }
+
+    public static String feishuGetRequestString(String url) {
+        // 构造请求
+        HttpEntityEnclosingRequestBase httpEntity = new HttpEntityEnclosingRequestBase() {
+            @Override
+            public String getMethod() {
+                return "GET";
+            }
+        };
+        CloseableHttpResponse response = null;
+        CloseableHttpClient client = null;
+        try {
+            client = HttpClientBuilder.create().build();
+            httpEntity.setURI(URI.create(url));
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
+            httpEntity.setConfig(requestConfig);
+            response = client.execute(httpEntity);
+            if (response != null && response.getStatusLine().getStatusCode() == 200) {
+                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
+                StringBuilder result = new StringBuilder();
+                String line = "";
+                while ((line = bufferedReader.readLine()) != null) {
+                    result.append(line);
+                }
+                bufferedReader.close();
+                return result.toString();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (response != null) {
+                    response.close();
+                }
+                if (client != null) {
+                    client.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
+
+    public static JSONObject feishuGetRequest(String accessToken, String url, JSONObject params) {
+        System.out.println(url);
+        // 构造请求
+        HttpEntityEnclosingRequestBase httpEntity = new HttpEntityEnclosingRequestBase() {
+            @Override
+            public String getMethod() {
+                return "GET";
+            }
+        };
+        if(accessToken != null){
+            httpEntity.setHeader("Authorization", accessToken);
+        }
+        CloseableHttpResponse response = null;
+        CloseableHttpClient client = null;
+        try {
+            client = HttpClientBuilder.create().build();
+            httpEntity.setURI(URI.create(url));
+            if (params != null){
+                httpEntity.setEntity(new StringEntity(params.toJSONString(), ContentType.APPLICATION_JSON));
+            }
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
+            httpEntity.setConfig(requestConfig);
+            response = client.execute(httpEntity);
+            if (response != null && response.getStatusLine().getStatusCode() == 200) {
+                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
+                StringBuilder result = new StringBuilder();
+                String line = "";
+                while ((line = bufferedReader.readLine()) != null) {
+                    result.append(line);
+                }
+                bufferedReader.close();
+                return JSONObject.parseObject(result.toString());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (response != null) {
+                    response.close();
+                }
+                if (client != null) {
+                    client.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
+
+
+
+    public static JSONObject feishuPostRequest(String accessToken, String url, JSONObject params) {
+        // 构造请求
+        HttpPost httpEntity = new HttpPost(url);
+        if(accessToken != null){
+            httpEntity.setHeader("Authorization", accessToken);
+        }
+        CloseableHttpResponse response = null;
+        CloseableHttpClient client = null;
+        try {
+            client = HttpClientBuilder.create().build();
+            httpEntity.setEntity(new StringEntity(params.toJSONString(), ContentType.APPLICATION_JSON));
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
+            httpEntity.setConfig(requestConfig);
+            response = client.execute(httpEntity);
+            if (response != null && response.getStatusLine().getStatusCode() == 200) {
+                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
+                StringBuilder result = new StringBuilder();
+                String line = "";
+                while ((line = bufferedReader.readLine()) != null) {
+                    result.append(line);
+                }
+                bufferedReader.close();
+                return JSONObject.parseObject(result.toString());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (response != null) {
+                    response.close();
+                }
+                if (client != null) {
+                    client.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
 }

+ 3 - 5
module-common/src/main/java/cn/com/ctop/common/module/utils/PropertiesUtils.java

@@ -15,15 +15,13 @@ import java.util.Properties;
  */
 public class PropertiesUtils {
     private static final Logger log = LoggerFactory.getLogger(PropertiesUtils.class);
-    private static Map<String, String> cache = new HashMap<String, String>();
-
+    private static Map<String, String> cache = new HashMap<>();
     public static String getConfig(String key) {
         return getValue("kuaishou_config", key);
     }
-
     public static String getValue(String name, String key) {
         try {
-            String cacheValue = (String) cache.get(name + key);
+            String cacheValue = cache.get(name + key);
             if (cacheValue != null) {
                 return cacheValue;
             }
@@ -49,7 +47,7 @@ public class PropertiesUtils {
                     + name + ".properties");
             props.load(in);
             Iterator<Object> it = props.keySet().iterator();
-            Map<String, String> map = new HashMap<String, String>();
+            Map<String, String> map = new HashMap<>();
             while (it.hasNext()) {
                 String key = it.next().toString();
                 String value = props.getProperty(key);

+ 7 - 6
feishu-sdk/src/main/java/cn/feishu/sdk/common/ApiConstant.java

@@ -1,11 +1,10 @@
-package cn.feishu.sdk.common;
+package cn.com.feishu.constant;
 
-import cn.feishu.sdk.util.PropertiesUtils;
 
-public class ApiConstant {
-    public static final String FEISHU_API_URL = PropertiesUtils.getConfig("feishu_api_url");
-    public static final String FEISHU_APP_ID = PropertiesUtils.getConfig("feishu_app_id");
-    public static final String FEISHU_APP_SECRET = PropertiesUtils.getConfig("feishu_app_secret");
+public class FeishuConstant {
+    public static final String FEISHU_API_URL = "https://open.feishu.cn/open-apis";
+    public static final String FEISHU_APP_ID = "cli_9e68af69ca34d00e";
+    public static final String FEISHU_APP_SECRET = "0RsCBRCLx1rG8HKfeZNeAbddxZ3Rsnwv";
     public static final String APP_ACCESS_TOKEN = "/auth/v3/app_access_token/internal/";
     public static final String TENANT_ACCESS_TOKEN = "/auth/v3/tenant_access_token/internal/";
     public static final String AUTH_INDEX = "/authen/v1/index";
@@ -15,4 +14,6 @@ public class ApiConstant {
     public static final String MESSAGE_BATCH_SEND = "/message/v4/batch_send/";
     public static final String MESSAGE_SEND = "/message/v4/send/";
     public static final String NOTIFY_SEND = "/notify/v4/appnotify";
+    public static final String REDIRECT_URL = "https://trac.tjyourong.com.cn/jeecg-boot/sys/feishu/auth";
+//    public static final String REDIRECT_URL = "http://192.168.0.111:8088/jeecg-boot/sys/feishu/auth";
 }

+ 87 - 0
module-common/src/main/java/cn/com/feishu/provider/AuthProvider.java

@@ -0,0 +1,87 @@
+package cn.com.feishu.provider;
+
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.feishu.constant.FeishuConstant;
+import com.alibaba.fastjson.JSONObject;
+
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URLEncoder;
+
+public class AuthProvider {
+    /**
+     *  获取授权url
+     * @param state
+     * @return
+     * @throws UnsupportedEncodingException
+     * @throws MalformedURLException
+     */
+    public static String getAuthUrl(String state) throws UnsupportedEncodingException {
+        String redirectUrl = FeishuConstant.REDIRECT_URL;
+        return FeishuConstant.FEISHU_API_URL+FeishuConstant.AUTH_INDEX+"?redirect_uri="+ URLEncoder.encode(redirectUrl,"UTF-8")+"&app_id="+FeishuConstant.FEISHU_APP_ID+"&state="+state;
+    }
+
+    /**
+     * 根据code获取用户登录信息
+     * @param code
+     * @return
+     * @throws Exception
+     */
+    public static JSONObject getFeishuUserInfo(String code) throws Exception {
+        JSONObject params = new JSONObject();
+        params.put("app_access_token",getAppAccessToken());
+        params.put("grant_type","authorization_code");
+        params.put("code",code);
+        return HttpUtils.feishuPostRequest(FeishuConstant.FEISHU_API_URL+FeishuConstant.AUTH_ACCESS_TOKEN,params);
+    }
+
+    public static JSONObject refreshAccessToken(String refreshToken) throws Exception{
+        JSONObject params = new JSONObject();
+        params.put("app_access_token",getAppAccessToken());
+        params.put("grant_type","refresh_token");
+        params.put("refresh_token",refreshToken);
+        return HttpUtils.feishuPostRequest(FeishuConstant.FEISHU_API_URL+FeishuConstant.REFRESH_AUTH_ACCESS_TOKEN,params);
+    }
+
+    public static JSONObject getUserInfo(String accessToken){
+        JSONObject params = new JSONObject();
+        params.put("user_access_token",accessToken);
+        return HttpUtils.feishuGetRequest("Bearer "+accessToken,FeishuConstant.FEISHU_API_URL+FeishuConstant.USER_INFO,params);
+    }
+
+    /**
+     * 获取企业自建应用token信息
+     * 调用接口获取应用资源时使用
+     * @return
+     * @throws Exception
+     */
+    public static String getAppAccessToken() throws Exception {
+        JSONObject params = new JSONObject();
+        params.put("app_id",FeishuConstant.FEISHU_APP_ID);
+        params.put("app_secret",FeishuConstant.FEISHU_APP_SECRET);
+        JSONObject resultNode = HttpUtils.feishuPostRequest(FeishuConstant.FEISHU_API_URL+FeishuConstant.APP_ACCESS_TOKEN,params);
+        if (resultNode.getIntValue("code")==0){
+            return resultNode.getString("app_access_token");
+        }else {
+            throw new Exception();
+        }
+    }
+
+    /**
+     * 获取企业自建应用租户token
+     * 调用接口获取企业资源时使用
+     * @return
+     * @throws Exception
+     */
+    public static String getTenantAccessToken() throws Exception {
+        JSONObject params = new JSONObject();
+        params.put("app_id",FeishuConstant.FEISHU_APP_ID);
+        params.put("app_secret",FeishuConstant.FEISHU_APP_SECRET);
+        JSONObject resultNode = HttpUtils.feishuPostRequest(FeishuConstant.FEISHU_API_URL+FeishuConstant.TENANT_ACCESS_TOKEN,params);
+        if (resultNode.getIntValue("code")==0){
+            return resultNode.getString("tenant_access_token");
+        }else {
+            throw new Exception();
+        }
+    }
+}

+ 5 - 6
feishu-sdk/src/main/java/cn/feishu/sdk/provider/MessageProvider.java

@@ -1,15 +1,14 @@
-package cn.feishu.sdk.provider;
+package cn.com.feishu.provider;
 
-import cn.feishu.sdk.common.ApiConstant;
-import cn.feishu.sdk.util.HttpUtil;
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.feishu.constant.FeishuConstant;
 import com.alibaba.fastjson.JSONObject;
 
 import java.util.List;
 
 public class MessageProvider {
     public JSONObject batchSend(List<String> departmentIds,List<String> openIds,List<String> userIds,String content) throws Exception {
-        AuthProvider authProvider = new AuthProvider();
-        String tenantAccessToken = authProvider.getTenantAccessToken();
+        String tenantAccessToken = AuthProvider.getTenantAccessToken();
         JSONObject contentJson = new JSONObject();
         contentJson.put("text",content);
         JSONObject params = new JSONObject();
@@ -18,7 +17,7 @@ public class MessageProvider {
         params.put("user_ids",userIds);
         params.put("msg_type","text");
         params.put("content",contentJson);
-        return HttpUtil.feishuPostRequest("Bearer"+tenantAccessToken, ApiConstant.FEISHU_API_URL+ApiConstant.MESSAGE_BATCH_SEND,params);
+        return HttpUtils.feishuPostRequest("Bearer"+tenantAccessToken, FeishuConstant.FEISHU_API_URL+FeishuConstant.MESSAGE_BATCH_SEND,params);
     }
 
 

+ 0 - 1
pom.xml

@@ -26,7 +26,6 @@
         <module>jeecg-boot-module-system</module>
         <module>module-job-bytedance</module>
         <module>module-job-kuaishou</module>
-        <module>feishu-sdk</module>
         <module>module-callback</module>
     </modules>