清理与ztcloud中重复的代码,改为 jar 包方式引用 ztcloud
This commit is contained in:
21
pom.xml
21
pom.xml
@@ -4,28 +4,19 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.zt.plat</groupId>
|
<groupId>com.zt.plat</groupId>
|
||||||
<artifactId>zt</artifactId>
|
<artifactId>zt-dsc</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modules>
|
<modules>
|
||||||
<module>zt-dependencies</module>
|
|
||||||
<module>zt-gateway</module>
|
<module>zt-gateway</module>
|
||||||
<module>zt-framework</module>
|
<module>zt-framework-dsc</module>
|
||||||
<!-- Server 主项目 -->
|
|
||||||
<!-- <module>zt-server</module>-->
|
|
||||||
<!-- 各种 module 拓展 -->
|
|
||||||
<module>zt-module-system</module>
|
<module>zt-module-system</module>
|
||||||
<module>zt-module-infra</module>
|
<module>zt-module-infra</module>
|
||||||
<module>zt-module-bpm</module>
|
<module>zt-module-bpm</module>
|
||||||
<module>zt-module-report</module>
|
<module>zt-module-report</module>
|
||||||
<!--<module>zt-module-mp</module>-->
|
|
||||||
<!-- <module>zt-module-ai</module>-->
|
|
||||||
<module>zt-module-template</module>
|
<module>zt-module-template</module>
|
||||||
<!-- <module>zt-module-iot</module>-->
|
|
||||||
<module>zt-module-databus</module>
|
<module>zt-module-databus</module>
|
||||||
<!-- <module>zt-module-rule</module>-->
|
<module>zt-server</module>
|
||||||
<!-- <module>zt-module-html2pdf</module>-->
|
|
||||||
<!-- <module>zt-server</module>-->
|
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<name>${project.artifactId}</name>
|
<name>${project.artifactId}</name>
|
||||||
@@ -57,6 +48,12 @@
|
|||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-common-dsc</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
29
zt-framework-dsc/pom.xml
Normal file
29
zt-framework-dsc/pom.xml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<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>
|
||||||
|
<parent>
|
||||||
|
<artifactId>zt-dsc</artifactId>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>zt-common-dsc</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<artifactId>zt-framework-dsc</artifactId>
|
||||||
|
<description>
|
||||||
|
该包是技术组件,每个子包,代表一个组件。每个组件包括两部分:
|
||||||
|
1. core 包:是该组件的核心封装
|
||||||
|
2. config 包:是该组件基于 Spring 的配置
|
||||||
|
|
||||||
|
技术组件,也分成两类:
|
||||||
|
1. 框架组件:和我们熟悉的 MyBatis、Redis 等等的拓展
|
||||||
|
2. 业务组件:和业务相关的组件的封装,例如说数据字典、操作日志等等。
|
||||||
|
如果是业务组件,Maven 名字会包含 biz
|
||||||
|
</description>
|
||||||
|
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -4,11 +4,11 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.zt.plat</groupId>
|
<groupId>com.zt.plat</groupId>
|
||||||
<artifactId>zt-framework</artifactId>
|
<artifactId>zt-framework-dsc</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>zt-common</artifactId>
|
<artifactId>zt-common-dsc</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>${project.artifactId}</name>
|
<name>${project.artifactId}</name>
|
||||||
@@ -16,6 +16,10 @@
|
|||||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-common</artifactId>
|
||||||
|
</dependency>
|
||||||
<!-- Spring 核心 -->
|
<!-- Spring 核心 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.zt.plat.framework.common.util.asyncTask;
|
package com.zt.plat.framework.common.util.asyncTask;
|
||||||
|
|
||||||
import com.alibaba.ttl.TransmittableThreadLocal;
|
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
@@ -11,7 +9,7 @@ import java.util.concurrent.*;
|
|||||||
* 多次提交,一次等待
|
* 多次提交,一次等待
|
||||||
*/
|
*/
|
||||||
public class AsyncLatchUtils {
|
public class AsyncLatchUtils {
|
||||||
private static final TransmittableThreadLocal<List<TaskInfo>> THREAD_LOCAL = TransmittableThreadLocal.withInitial(LinkedList::new);
|
private static final ThreadLocal<List<TaskInfo>> THREADLOCAL = ThreadLocal.withInitial(LinkedList::new);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交一个异步任务
|
* 提交一个异步任务
|
||||||
@@ -19,7 +17,7 @@ public class AsyncLatchUtils {
|
|||||||
* @param runnable 需要异步执行的具体业务逻辑
|
* @param runnable 需要异步执行的具体业务逻辑
|
||||||
*/
|
*/
|
||||||
public static void submitTask(Executor executor, Runnable runnable) {
|
public static void submitTask(Executor executor, Runnable runnable) {
|
||||||
THREAD_LOCAL.get().add(new TaskInfo(executor, runnable));
|
THREADLOCAL.get().add(new TaskInfo(executor, runnable));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,8 +25,8 @@ public class AsyncLatchUtils {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private static List<TaskInfo> popTask() {
|
private static List<TaskInfo> popTask() {
|
||||||
List<TaskInfo> taskInfos = THREAD_LOCAL.get();
|
List<TaskInfo> taskInfos = THREADLOCAL.get();
|
||||||
THREAD_LOCAL.remove();
|
THREADLOCAL.remove();
|
||||||
return taskInfos;
|
return taskInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,10 +57,7 @@ public class AsyncLatchUtils {
|
|||||||
boolean await = false;
|
boolean await = false;
|
||||||
try {
|
try {
|
||||||
await = latch.await(timeout, timeUnit);
|
await = latch.await(timeout, timeUnit);
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {}
|
||||||
// 恢复中断状态
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
}
|
|
||||||
return await;
|
return await;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<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>
|
|
||||||
<parent>
|
|
||||||
<artifactId>zt</artifactId>
|
|
||||||
<groupId>com.zt.plat</groupId>
|
|
||||||
<version>${revision}</version>
|
|
||||||
</parent>
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
<modules>
|
|
||||||
<module>zt-common</module>
|
|
||||||
<module>zt-spring-boot-starter-env</module>
|
|
||||||
<module>zt-spring-boot-starter-mybatis</module>
|
|
||||||
<module>zt-spring-boot-starter-redis</module>
|
|
||||||
<module>zt-spring-boot-starter-web</module>
|
|
||||||
<module>zt-spring-boot-starter-security</module>
|
|
||||||
<module>zt-spring-boot-starter-websocket</module>
|
|
||||||
<module>zt-spring-boot-starter-databus-server</module>
|
|
||||||
<module>zt-spring-boot-starter-databus-client</module>
|
|
||||||
<module>zt-spring-boot-starter-monitor</module>
|
|
||||||
<module>zt-spring-boot-starter-protection</module>
|
|
||||||
<!-- <module>zt-spring-boot-starter-config</module>-->
|
|
||||||
<module>zt-spring-boot-starter-job</module>
|
|
||||||
<module>zt-spring-boot-starter-mq</module>
|
|
||||||
<module>zt-spring-boot-starter-rpc</module>
|
|
||||||
<module>zt-spring-boot-starter-seata-dm</module>
|
|
||||||
<module>zt-spring-boot-starter-excel</module>
|
|
||||||
<module>zt-spring-boot-starter-test</module>
|
|
||||||
|
|
||||||
<module>zt-spring-boot-starter-biz-tenant</module>
|
|
||||||
<module>zt-spring-boot-starter-biz-data-permission</module>
|
|
||||||
<module>zt-spring-boot-starter-biz-ip</module>
|
|
||||||
<module>zt-spring-boot-starter-biz-business</module>
|
|
||||||
</modules>
|
|
||||||
|
|
||||||
<artifactId>zt-framework</artifactId>
|
|
||||||
<description>
|
|
||||||
该包是技术组件,每个子包,代表一个组件。每个组件包括两部分:
|
|
||||||
1. core 包:是该组件的核心封装
|
|
||||||
2. config 包:是该组件基于 Spring 的配置
|
|
||||||
|
|
||||||
技术组件,也分成两类:
|
|
||||||
1. 框架组件:和我们熟悉的 MyBatis、Redis 等等的拓展
|
|
||||||
2. 业务组件:和业务相关的组件的封装,例如说数据字典、操作日志等等。
|
|
||||||
如果是业务组件,Maven 名字会包含 biz
|
|
||||||
</description>
|
|
||||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
|
||||||
|
|
||||||
</project>
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
package com.fhs.trans.service;
|
|
||||||
|
|
||||||
import com.fhs.core.trans.vo.VO;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 只有实现了这个接口的才能自动翻译
|
|
||||||
*
|
|
||||||
* 为什么要赋值粘贴到 zt-common 包下?
|
|
||||||
* 因为 AutoTransable 属于 easy-trans-service 下,无法方便的在 zt-module-xxx-api 模块下使用
|
|
||||||
*
|
|
||||||
* @author jackwang
|
|
||||||
* @since 2020-05-19 10:26:15
|
|
||||||
*/
|
|
||||||
public interface AutoTransable<V extends VO> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据 ids 查询数据列表
|
|
||||||
*
|
|
||||||
* 改方法已过期啦,请使用 selectByIds
|
|
||||||
*
|
|
||||||
* @param ids 编号数组
|
|
||||||
* @return 数据列表
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
default List<V> findByIds(List<? extends Object> ids){
|
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据 ids 查询
|
|
||||||
*
|
|
||||||
* @param ids 编号数组
|
|
||||||
* @return 数据列表
|
|
||||||
*/
|
|
||||||
default List<V> selectByIds(List<? extends Object> ids){
|
|
||||||
return this.findByIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取 db 中所有的数据
|
|
||||||
*
|
|
||||||
* @return db 中所有的数据
|
|
||||||
*/
|
|
||||||
default List<V> select(){
|
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据 id 获取 vo
|
|
||||||
*
|
|
||||||
* @param primaryValue id
|
|
||||||
* @return vo
|
|
||||||
*/
|
|
||||||
V selectById(Object primaryValue);
|
|
||||||
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user