1. 统一包名修改
This commit is contained in:
@@ -2,9 +2,9 @@ package com.zt.plat.framework.test.core.ut;
|
||||
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.zt.plat.framework.common.biz.system.sequence.SequenceCommonApi;
|
||||
import com.zt.plat.framework.datasource.config.CloudDataSourceAutoConfiguration;
|
||||
import com.zt.plat.framework.mybatis.config.CloudMybatisAutoConfiguration;
|
||||
import com.zt.plat.framework.redis.config.CloudRedisAutoConfiguration;
|
||||
import com.zt.plat.framework.datasource.config.ZtDataSourceAutoConfiguration;
|
||||
import com.zt.plat.framework.mybatis.config.ZtMybatisAutoConfiguration;
|
||||
import com.zt.plat.framework.redis.config.ZtRedisAutoConfiguration;
|
||||
import com.zt.plat.framework.test.config.RedisTestConfiguration;
|
||||
import com.zt.plat.framework.test.config.SqlInitializationTestConfiguration;
|
||||
import com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure;
|
||||
@@ -36,18 +36,18 @@ public class BaseDbAndRedisUnitTest {
|
||||
|
||||
@Import({
|
||||
// DB 配置类
|
||||
CloudDataSourceAutoConfiguration.class, // 自己的 DB 配置类
|
||||
ZtDataSourceAutoConfiguration.class, // 自己的 DB 配置类
|
||||
DataSourceAutoConfiguration.class, // Spring DB 自动配置类
|
||||
DataSourceTransactionManagerAutoConfiguration.class, // Spring 事务自动配置类
|
||||
DruidDataSourceAutoConfigure.class, // Druid 自动配置类
|
||||
SqlInitializationTestConfiguration.class, // SQL 初始化
|
||||
// MyBatis 配置类
|
||||
CloudMybatisAutoConfiguration.class, // 自己的 MyBatis 配置类
|
||||
ZtMybatisAutoConfiguration.class, // 自己的 MyBatis 配置类
|
||||
MybatisPlusAutoConfiguration.class, // MyBatis 的自动配置类
|
||||
|
||||
// Redis 配置类
|
||||
RedisTestConfiguration.class, // Redis 测试配置类,用于启动 RedisServer
|
||||
CloudRedisAutoConfiguration.class, // 自己的 Redis 配置类
|
||||
ZtRedisAutoConfiguration.class, // 自己的 Redis 配置类
|
||||
RedisAutoConfiguration.class, // Spring Redis 自动配置类
|
||||
RedissonAutoConfiguration.class, // Redisson 自动配置类
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.zt.plat.framework.test.core.ut;
|
||||
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.zt.plat.framework.common.biz.system.sequence.SequenceCommonApi;
|
||||
import com.zt.plat.framework.datasource.config.CloudDataSourceAutoConfiguration;
|
||||
import com.zt.plat.framework.mybatis.config.CloudMybatisAutoConfiguration;
|
||||
import com.zt.plat.framework.datasource.config.ZtDataSourceAutoConfiguration;
|
||||
import com.zt.plat.framework.mybatis.config.ZtMybatisAutoConfiguration;
|
||||
import com.zt.plat.framework.test.config.SqlInitializationTestConfiguration;
|
||||
import com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure;
|
||||
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
|
||||
@@ -37,13 +37,13 @@ public class BaseDbUnitTest {
|
||||
|
||||
@Import({
|
||||
// DB 配置类
|
||||
CloudDataSourceAutoConfiguration.class, // 自己的 DB 配置类
|
||||
ZtDataSourceAutoConfiguration.class, // 自己的 DB 配置类
|
||||
DataSourceAutoConfiguration.class, // Spring DB 自动配置类
|
||||
DataSourceTransactionManagerAutoConfiguration.class, // Spring 事务自动配置类
|
||||
DruidDataSourceAutoConfigure.class, // Druid 自动配置类
|
||||
SqlInitializationTestConfiguration.class, // SQL 初始化
|
||||
// MyBatis 配置类
|
||||
CloudMybatisAutoConfiguration.class, // 自己的 MyBatis 配置类
|
||||
ZtMybatisAutoConfiguration.class, // 自己的 MyBatis 配置类
|
||||
MybatisPlusAutoConfiguration.class, // MyBatis 的自动配置类
|
||||
MybatisPlusJoinAutoConfiguration.class, // MyBatis 的Join配置类
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public abstract class BaseGenerator {
|
||||
System.out.print(prompt);
|
||||
input.put("names", scanner.nextLine());
|
||||
|
||||
System.out.print("请输入作者名称(例如:cloud): ");
|
||||
System.out.print("请输入作者名称(例如:zt): ");
|
||||
input.put("author", scanner.nextLine());
|
||||
|
||||
System.out.print("请输入起始端口号(例如:8080): ");
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.zt.plat.framework.test.core.ut;
|
||||
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.zt.plat.framework.common.biz.system.sequence.SequenceCommonApi;
|
||||
import com.zt.plat.framework.redis.config.CloudRedisAutoConfiguration;
|
||||
import com.zt.plat.framework.redis.config.ZtRedisAutoConfiguration;
|
||||
import com.zt.plat.framework.test.config.RedisTestConfiguration;
|
||||
import org.redisson.spring.starter.RedissonAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
|
||||
@@ -33,7 +33,7 @@ public class BaseRedisUnitTest {
|
||||
// Redis 配置类
|
||||
RedisTestConfiguration.class, // Redis 测试配置类,用于启动 RedisServer
|
||||
RedisAutoConfiguration.class, // Spring Redis 自动配置类
|
||||
CloudRedisAutoConfiguration.class, // 自己的 Redis 配置类
|
||||
ZtRedisAutoConfiguration.class, // 自己的 Redis 配置类
|
||||
RedissonAutoConfiguration.class, // Redisson 自动配置类
|
||||
|
||||
// 其它配置类
|
||||
|
||||
@@ -8,12 +8,12 @@ import java.util.Map;
|
||||
import static com.zt.plat.framework.test.core.ut.GeneratorUtils.camelToKebabCase;
|
||||
|
||||
/**
|
||||
* Cloud 模块代码生成器 - 使用 VM 模板
|
||||
* Zt 模块代码生成器 - 使用 VM 模板
|
||||
*
|
||||
* 使用方法:
|
||||
* 1. 在 IDE 中,右键运行 {@link #main(String[])} 方法
|
||||
* 2. 根据提示,输入模块名,例如 "order"
|
||||
* 3. 根据提示,输入作者名,例如 "cloud"
|
||||
* 3. 根据提示,输入作者名,例如 "zt"
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@@ -36,7 +36,7 @@ public class ModuleGenerator extends BaseGenerator {
|
||||
generator.batchCreate(modules, author, startPort, "模块");
|
||||
|
||||
// 3. 输出完成信息
|
||||
printCompletionInfo(modules, "模块", "cloud-module-{name}");
|
||||
printCompletionInfo(modules, "模块", "zt-module-{name}");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,7 +45,7 @@ public class ModuleGenerator extends BaseGenerator {
|
||||
String dashModuleName = camelToKebabCase(moduleName);
|
||||
|
||||
// 定义新模块路径
|
||||
Path newModuleDir = projectRoot.resolve("cloud-module-" + dashModuleName);
|
||||
Path newModuleDir = projectRoot.resolve("zt-module-" + dashModuleName);
|
||||
|
||||
if (checkDirectoryExists(newModuleDir, dashModuleName)) {
|
||||
return;
|
||||
@@ -83,7 +83,7 @@ public class ModuleGenerator extends BaseGenerator {
|
||||
moduleDir.resolve("pom.xml"), variables);
|
||||
|
||||
// 2. 创建 API 模块
|
||||
Path apiDir = moduleDir.resolve("cloud-module-" + dashModuleName + "-api");
|
||||
Path apiDir = moduleDir.resolve("zt-module-" + dashModuleName + "-api");
|
||||
Files.createDirectories(apiDir);
|
||||
|
||||
// API 模块的 Java 源码目录
|
||||
@@ -103,7 +103,7 @@ public class ModuleGenerator extends BaseGenerator {
|
||||
enumsDir.resolve("ErrorCodeConstants.java"), variables);
|
||||
|
||||
// 3. 创建 Server 模块
|
||||
Path serverDir = moduleDir.resolve("cloud-module-" + dashModuleName + "-server");
|
||||
Path serverDir = moduleDir.resolve("zt-module-" + dashModuleName + "-server");
|
||||
Files.createDirectories(serverDir);
|
||||
|
||||
// Server 模块的 Java 源码目录
|
||||
|
||||
@@ -8,12 +8,12 @@ import java.util.Map;
|
||||
import static com.zt.plat.framework.test.core.ut.GeneratorUtils.toPascalCase;
|
||||
|
||||
/**
|
||||
* Cloud Server 代码生成器 - 使用 VM 模板
|
||||
* Zt Server 代码生成器 - 使用 VM 模板
|
||||
*
|
||||
* 使用方法:
|
||||
* 1. 在 IDE 中,右键运行 {@link #main(String[])} 方法
|
||||
* 2. 根据提示,输入新 Server 的名称,例如 "demo-server"
|
||||
* 3. 根据提示,输入作者名,例如 "cloud"
|
||||
* 3. 根据提示,输入作者名,例如 "zt"
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
|
||||
@@ -87,8 +87,8 @@ mybatis-plus:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
|
||||
# ZT配置项,设置当前项目所有自定义的配置
|
||||
cloud:
|
||||
# 芋道配置项,设置当前项目所有自定义的配置
|
||||
zt:
|
||||
env: # 多环境的配置项
|
||||
tag: ${dollar}{HOSTNAME}
|
||||
security:
|
||||
|
||||
@@ -102,13 +102,13 @@ xxl:
|
||||
logpath: ${dollar}{user.home}/logs/xxl-job/${dollar}{spring.application.name} # 执行器运行日志文件存储磁盘路径
|
||||
accessToken: default_token # 执行器通讯TOKEN
|
||||
|
||||
cloud:
|
||||
zt:
|
||||
info:
|
||||
version: 1.0.0
|
||||
base-package: ${basePackage}.module.${packageName}
|
||||
web:
|
||||
admin-ui:
|
||||
url: http://dashboard.cloud.iocoder.cn # Admin 管理后台 UI 的地址
|
||||
url: http://dashboard.zt.iocoder.cn # Admin 管理后台 UI 的地址
|
||||
xss:
|
||||
enable: false
|
||||
exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系
|
||||
@@ -117,7 +117,7 @@ cloud:
|
||||
swagger:
|
||||
title: 管理后台
|
||||
description: 提供管理员管理的所有功能
|
||||
version: ${dollar}{cloud.info.version}
|
||||
version: ${dollar}{zt.info.version}
|
||||
tenant: # 多租户相关配置项
|
||||
enable: true
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
*
|
||||
* @author ${author}
|
||||
*/
|
||||
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${dollar}{cloud.info.base-package}
|
||||
@SpringBootApplication(scanBasePackages = {"${dollar}{cloud.info.base-package}.${packageName}", "${dollar}{cloud.info.base-package}.module"},
|
||||
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${dollar}{zt.info.base-package}
|
||||
@SpringBootApplication(scanBasePackages = {"${dollar}{zt.info.base-package}.${packageName}", "${dollar}{zt.info.base-package}.module"},
|
||||
excludeName = {})
|
||||
public class ${applicationClassName} {
|
||||
|
||||
|
||||
@@ -114,10 +114,10 @@ logging:
|
||||
# 配置自己写的 MyBatis Mapper 打印日志
|
||||
${basePackage}.${packageName}.dal.dao: debug
|
||||
|
||||
--- #################### ZT相关配置 ####################
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
# ZT配置项,设置当前项目所有自定义的配置
|
||||
cloud:
|
||||
# 芋道配置项,设置当前项目所有自定义的配置
|
||||
zt:
|
||||
demo: false # 开启演示模式
|
||||
# 附件加密相关配置
|
||||
AES:
|
||||
|
||||
@@ -115,10 +115,10 @@ logging:
|
||||
${basePackage}.${packageName}.dal.dao: debug
|
||||
root: info
|
||||
|
||||
--- #################### ZT相关配置 ####################
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
# ZT配置项,设置当前项目所有自定义的配置
|
||||
cloud:
|
||||
# 芋道配置项,设置当前项目所有自定义的配置
|
||||
zt:
|
||||
demo: false # 开启演示模式
|
||||
# 附件加密相关配置
|
||||
AES:
|
||||
|
||||
@@ -65,9 +65,9 @@ spring:
|
||||
repositories:
|
||||
enabled: false # 项目未使用到 Spring Data Redis 的 Repository,所以直接禁用,保证启动速度
|
||||
|
||||
--- #################### ZT相关配置 ####################
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
cloud:
|
||||
zt:
|
||||
info:
|
||||
version: 1.0.0
|
||||
base-package: ${basePackage}
|
||||
@@ -96,7 +96,7 @@ cloud:
|
||||
swagger:
|
||||
title: ${serverName}
|
||||
description: ${serverDescription}
|
||||
version: ${cloud.info.version}
|
||||
version: ${zt.info.version}
|
||||
email: xingyu4j@vip.qq.com
|
||||
license: MIT
|
||||
license-url: https://gitee.com/zhijiantianya/ruoyi-vue-pro/blob/master/LICENSE
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-rpc</artifactId>
|
||||
<!-- 目的:cloud-server 单体启动,禁用 openfeign -->
|
||||
<!-- 目的:zt-server 单体启动,禁用 openfeign -->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
|
||||
@@ -1 +1 @@
|
||||
<https://www.iocoder.cn/Spring-Boot/Unit-Test/?cloud>
|
||||
<https://www.iocoder.cn/Spring-Boot/Unit-Test/?zt>
|
||||
|
||||
Reference in New Issue
Block a user