Procházet zdrojové kódy

feat(database): 添加物理数据表备注字段

- 在 t_physical_data 表中新增 remark 字段用于存储备注信息
- 更新相关数据库文档以反映新字段的添加

fix(pom): 移除重复的 validation starter 依赖

- 删除 pom.xml 中重复声明的 spring-boot-starter-validation 依赖项
- 确保项目依赖结构清晰且无冗余

chore(build): 添加 Spring Boot Maven 插件配置

- 在 pom.xml 中添加 spring-boot-maven-plugin 插件配置
- 配置 repackage goal 以支持可执行 JAR 的构建

chore(script): 新增 Windows 批处理脚本用于构建和运行应用

- 添加 build-and-run.bat 脚本实现一键构建和启动应用
- 添加 run-jar.bat 脚本用于直接从 JAR 文件运行应用
- 添加 run.bat 脚本通过 Maven 运行应用
- 脚本中包含环境检查和错误处理逻辑
mcbaiyun před 1 měsícem
rodič
revize
5b28ee5fa1
5 změnil soubory, kde provedl 69 přidání a 5 odebrání
  1. 25 0
      build-and-run.bat
  2. 1 0
      docs/DataBase/t_physical_data.txt
  3. 18 5
      pom.xml
  4. 12 0
      run-jar.bat
  5. 13 0
      run.bat

+ 25 - 0
build-and-run.bat

@@ -0,0 +1,25 @@
+@echo off
+echo Building and Running Chronic Disease App...
+
+REM Check if Maven is installed
+where mvn >nul 2>nul
+if %errorlevel% neq 0 (
+    echo Error: Maven is not installed or not in PATH
+    pause
+    exit /b 1
+)
+
+echo Cleaning project...
+call mvn clean
+
+echo Building project...
+call mvn package
+
+if %errorlevel% neq 0 (
+    echo Error: Build failed
+    pause
+    exit /b 1
+)
+
+echo Running application...
+java -jar target/ChronicDiseaseApp-1.0-SNAPSHOT.jar

+ 1 - 0
docs/DataBase/t_physical_data.txt

@@ -9,6 +9,7 @@ CREATE TABLE `t_physical_data` (
   `update_user` BIGINT COMMENT '更新者ID',
   `update_time` DATETIME COMMENT '更新时间',
   `version` INT DEFAULT 0 COMMENT '乐观锁版本号',
+  `remark` VARCHAR(255) COMMENT '备注',
   PRIMARY KEY (`id`),
   KEY `idx_physical_user_measure_time` (`user_id`, `measure_time`),
   KEY `idx_physical_user_id` (`user_id`)

+ 18 - 5
pom.xml

@@ -99,11 +99,7 @@
             <version>${knife4j.version}</version>
         </dependency>
 
-        <!-- Validation starter (ensure single declaration only) -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-validation</artifactId>
-        </dependency>
+
 
         <!-- Test dependencies -->
         <dependency>
@@ -112,4 +108,21 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>${spring-boot.version}</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>

+ 12 - 0
run-jar.bat

@@ -0,0 +1,12 @@
+@echo off
+echo Running Chronic Disease App from JAR...
+
+REM Check if the JAR file exists
+if not exist "target\ChronicDiseaseApp-1.0-SNAPSHOT.jar" (
+    echo Error: JAR file not found. Please build the project first using 'mvn package'.
+    pause
+    exit /b 1
+)
+
+echo Starting application...
+java -jar target\ChronicDiseaseApp-1.0-SNAPSHOT.jar

+ 13 - 0
run.bat

@@ -0,0 +1,13 @@
+@echo off
+echo Starting Chronic Disease App...
+
+REM Check if Maven is installed
+where mvn >nul 2>nul
+if %errorlevel% neq 0 (
+    echo Error: Maven is not installed or not in PATH
+    pause
+    exit /b 1
+)
+
+echo Running application with Maven...
+mvn spring-boot:run