diff --git a/.gitee/ISSUE_TEMPLATE.zh-CN.md b/.gitee/ISSUE_TEMPLATE.zh-CN.md deleted file mode 100644 index efdd1b07..00000000 --- a/.gitee/ISSUE_TEMPLATE.zh-CN.md +++ /dev/null @@ -1,25 +0,0 @@ -碰到问题,请在 搜索是否存在相似的 issue。 - -不按照模板提交的 issue,会被系统自动删除。 - -### 基本信息 - -- ruoyi-vue-pro 版本: -- 操作系统: -- 数据库: - -### 你猜测可能的原因 - -(必填)我花费了 2-4 小时自查,发现可能的原因是:xxxxxx - -### 复现步骤 - -第一步, - -第二步, - -第三步, - -### 报错信息 - -带上必要的截图 diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md deleted file mode 100644 index 5d1f257e..00000000 --- a/.github/ISSUE_TEMPLATE/question.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -name: 问题反馈 -about: 请详细描述,以便更高快的获得到解决 -title: '' -labels: '' -assignees: '' - ---- - -碰到问题,请在 搜索是否存在相似的 issue。 - -不按照模板提交的 issue,会被系统自动删除。 - -### 基本信息 - -- ruoyi-vue-pro 版本: -- 操作系统: -- 数据库: - -### 你猜测可能的原因 - -(必填)我花费了 2-4 小时自查,发现可能的原因是:xxxxxx - -### 复现步骤 - -第一步, - -第二步, - -第三步, - -### 报错信息 - -带上必要的截图 diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index 7c765927..00000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,30 +0,0 @@ -# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: Java CI with Maven - -on: - push: - branches: [ master ] - # pull_request: - # branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - java: [ '8', '11', '17' ] - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK ${{ matrix.Java }} - uses: actions/setup-java@v2 - with: - java-version: ${{ matrix.java }} - distribution: 'temurin' - cache: maven - - name: Build with Maven - run: mvn -B package --file pom.xml -Dmaven.test.skip=true diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/ModuleGenerator.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/ModuleGenerator.java index cd13c056..e6022b3c 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/ModuleGenerator.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/ModuleGenerator.java @@ -158,6 +158,28 @@ public class ModuleGenerator { return processErrorCodeConstants(content, moduleName, packageName, author); } + // 处理配置文件 + if (fileName.endsWith(".yml") || fileName.endsWith(".yaml")) { + String newContent = content; + + // 替换应用名称 + newContent = newContent.replace("name: yudao-module-template-server", "name: yudao-module-" + moduleName + "-server"); + + // 处理端口配置 + if (newContent.contains("port:")) { + // 使用更精确的正则表达式来匹配端口行 + newContent = newContent.replaceAll("(?m)^(\\s*)port:\\s*\\d+\\s*$", "$1port: " + port); + } else if (newContent.contains("server:")) { + // 如果有server配置但没有port,在server下添加port + newContent = newContent.replaceAll("(?m)^(\\s*)server:\\s*$", "$1server:\n$1 port: " + port); + } else { + // 如果完全没有server配置,在文件开头添加 + newContent = "server:\n port: " + port + "\n\n" + newContent; + } + + return newContent; + } + return content.replace("yudao-module-template", "yudao-module-" + moduleName) .replace("cn.iocoder.yudao.module.template", BASE_PACKAGE + packageName) .replace("TemplateServerApplication", capitalizedModuleName + "ServerApplication") diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/ServerGenerator.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/ServerGenerator.java index 17f89948..498e8055 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/ServerGenerator.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/ServerGenerator.java @@ -35,10 +35,7 @@ public class ServerGenerator { int startPort = Integer.parseInt(scanner.nextLine()); scanner.close(); - // 分割服务器名 - String[] servers = baseNames.split(","); - - // 分割服务器名 + // 分割服务名 String[] servers = baseNames.split(","); // 2. 定义项目根路径 @@ -149,17 +146,22 @@ public class ServerGenerator { // 移除对 yudao-module-xxx-server 的依赖,但保留 system-server 和 infra-server return newContent.replaceAll("(?m)^\\s*\\s*cn\\.iocoder\\.cloud\\s*yudao-module-(?!system-server|infra-server).*-server[\\s\\S]*?\\s*", ""); case "application.yaml": - case "application.yml": - // 替换应用名称和端口号 + case "application-dev.yaml": + case "application-prod.yaml": + case "application-test.yaml": + case "application-local.yaml": + // 替换应用名称 newContent = newContent.replace("name: yudao-server", "name: " + serverName); - // 如果有端口配置,替换端口号,如果没有则添加端口配置 - if (newContent.contains("server:")) { - if (newContent.contains("port:")) { - newContent = newContent.replaceAll("(?m)^\\s*port:.*$", " port: " + port); - } else { - newContent = newContent.replace("server:", "server:\n port: " + port); - } + + // 处理端口配置 - 更精确的替换逻辑 + if (newContent.contains("port:")) { + // 使用更精确的正则表达式来匹配端口行 + newContent = newContent.replaceAll("(?m)^(\\s*)port:\\s*\\d+\\s*$", "$1port: " + port); + } else if (newContent.contains("server:")) { + // 如果有server配置但没有port,在server下添加port + newContent = newContent.replaceAll("(?m)^(\\s*)server:\\s*$", "$1server:\n$1 port: " + port); } else { + // 如果完全没有server配置,在文件开头添加 newContent = "server:\n port: " + port + "\n\n" + newContent; } return newContent;