调整了依赖
This commit is contained in:
parent
ec71a0849d
commit
f5816eb60b
@ -5,6 +5,7 @@ import ink.wgink.common.manager.env.EnvManager;
|
|||||||
import ink.wgink.interfaces.init.IInitBaseMenu;
|
import ink.wgink.interfaces.init.IInitBaseMenu;
|
||||||
import ink.wgink.interfaces.init.IInitBaseTable;
|
import ink.wgink.interfaces.init.IInitBaseTable;
|
||||||
import ink.wgink.interfaces.init.IInitBaseUser;
|
import ink.wgink.interfaces.init.IInitBaseUser;
|
||||||
|
import ink.wgink.interfaces.init.IInitMongoData;
|
||||||
import ink.wgink.properties.ServerProperties;
|
import ink.wgink.properties.ServerProperties;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.ApplicationArguments;
|
import org.springframework.boot.ApplicationArguments;
|
||||||
@ -43,28 +44,52 @@ public class CommonStartup implements ApplicationRunner {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(ApplicationArguments args) throws Exception {
|
public void run(ApplicationArguments args) throws Exception {
|
||||||
if (serverProperties.getInit() == null || serverProperties.getInit().getTable()) {
|
serverInit();
|
||||||
// 建表
|
initManager();
|
||||||
Map<String, IInitBaseTable> initBaseTableMap = applicationContext.getBeansOfType(IInitBaseTable.class);
|
initMongoData();
|
||||||
for (Map.Entry<String, IInitBaseTable> kv : initBaseTableMap.entrySet()) {
|
}
|
||||||
kv.getValue().createTable();
|
|
||||||
}
|
/**
|
||||||
}
|
* 初始化 mongo 数据
|
||||||
if (serverProperties.getInit() == null || serverProperties.getInit().getMenu()) {
|
*/
|
||||||
// 初始化菜单
|
private void initMongoData() {
|
||||||
if (initBaseMenu != null) {
|
Map<String, IInitMongoData> initMongoDataMap = applicationContext.getBeansOfType(IInitMongoData.class);
|
||||||
initBaseMenu.init();
|
initMongoDataMap.forEach((key, value) -> value.init());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (serverProperties.getInit() == null || serverProperties.getInit().getUser()) {
|
/**
|
||||||
// 创建用户
|
* 初始化管理器
|
||||||
if (initBaseUser != null) {
|
*/
|
||||||
initBaseUser.init();
|
private void initManager() {
|
||||||
}
|
|
||||||
}
|
|
||||||
// 初始化环境变量
|
// 初始化环境变量
|
||||||
EnvManager envManager = EnvManager.getInstance();
|
EnvManager envManager = EnvManager.getInstance();
|
||||||
envManager.setEnvDao(envDao);
|
envManager.setEnvDao(envDao);
|
||||||
envManager.refreshEnv();
|
envManager.refreshEnv();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务初始化
|
||||||
|
*/
|
||||||
|
private void serverInit() {
|
||||||
|
boolean isInitTable = serverProperties.getInit() == null || serverProperties.getInit().getTable();
|
||||||
|
boolean isInitMenu = serverProperties.getInit() == null || serverProperties.getInit().getMenu();
|
||||||
|
boolean isInitUser = serverProperties.getInit() == null || serverProperties.getInit().getUser();
|
||||||
|
if (isInitTable) {
|
||||||
|
// 建表
|
||||||
|
Map<String, IInitBaseTable> initBaseTableMap = applicationContext.getBeansOfType(IInitBaseTable.class);
|
||||||
|
initBaseTableMap.forEach((key, value) -> value.createTable());
|
||||||
|
}
|
||||||
|
if (isInitMenu) {
|
||||||
|
// 初始化菜单
|
||||||
|
if (initBaseMenu != null) {
|
||||||
|
initBaseMenu.init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isInitUser) {
|
||||||
|
// 创建用户
|
||||||
|
if (initBaseUser != null) {
|
||||||
|
initBaseUser.init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
32
pom.xml
32
pom.xml
@ -48,14 +48,15 @@
|
|||||||
<module>basic-abstract</module>
|
<module>basic-abstract</module>
|
||||||
<module>module-examine</module>
|
<module>module-examine</module>
|
||||||
<module>mongo-login</module>
|
<module>mongo-login</module>
|
||||||
|
<module>mongo-menu</module>
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<spring.version>5.2.20.RELEASE</spring.version>
|
<spring.version>5.3.20</spring.version>
|
||||||
<spring-security.version>5.2.9.RELEASE</spring-security.version>
|
<spring-security.version>5.2.9.RELEASE</spring-security.version>
|
||||||
<spring-boot.version>2.3.3.RELEASE</spring-boot.version>
|
<spring-boot.version>2.7.0</spring-boot.version>
|
||||||
<fastjson.version>1.2.25</fastjson.version>
|
<fastjson.version>1.2.25</fastjson.version>
|
||||||
<fastjson2.version>2.0.2</fastjson2.version>
|
<fastjson2.version>2.0.2</fastjson2.version>
|
||||||
<json.version>20210307</json.version>
|
<json.version>20210307</json.version>
|
||||||
@ -100,11 +101,8 @@
|
|||||||
<activiti.version>6.0.0</activiti.version>
|
<activiti.version>6.0.0</activiti.version>
|
||||||
<xmlgraphics.version>1.10</xmlgraphics.version>
|
<xmlgraphics.version>1.10</xmlgraphics.version>
|
||||||
<minio.version>8.2.1</minio.version>
|
<minio.version>8.2.1</minio.version>
|
||||||
<mongo.version>3.2.5</mongo.version>
|
<mongo.version>3.4.0</mongo.version>
|
||||||
<redis.version>2.5.5</redis.version>
|
<redis.version>2.5.5</redis.version>
|
||||||
<freemarker.version>2.3.31</freemarker.version>
|
|
||||||
<gson.version>2.8.5</gson.version>
|
|
||||||
<jsoup.version>1.14.3</jsoup.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
@ -206,6 +204,14 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<!-- json end -->
|
<!-- json end -->
|
||||||
|
|
||||||
|
<!-- jackson start -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
<version>2.13.3</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- jackson end -->
|
||||||
|
|
||||||
<!-- easyexcel start -->
|
<!-- easyexcel start -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
@ -545,7 +551,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.freemarker</groupId>
|
<groupId>org.freemarker</groupId>
|
||||||
<artifactId>freemarker</artifactId>
|
<artifactId>freemarker</artifactId>
|
||||||
<version>${freemarker.version}</version>
|
<version>2.3.31</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- freemarker end -->
|
<!-- freemarker end -->
|
||||||
|
|
||||||
@ -553,7 +559,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
<version>${gson.version}</version>
|
<version>2.8.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- gson end -->
|
<!-- gson end -->
|
||||||
|
|
||||||
@ -561,9 +567,17 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jsoup</groupId>
|
<groupId>org.jsoup</groupId>
|
||||||
<artifactId>jsoup</artifactId>
|
<artifactId>jsoup</artifactId>
|
||||||
<version>${jsoup.version}</version>
|
<version>1.14.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- jsoup end -->
|
<!-- jsoup end -->
|
||||||
|
|
||||||
|
<!-- xmlgraphics-commons start -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.xmlgraphics</groupId>
|
||||||
|
<artifactId>xmlgraphics-commons</artifactId>
|
||||||
|
<version>2.7</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- xmlgraphics-commons end -->
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
Loading…
Reference in New Issue
Block a user