Browse Source

修改文件

master
qimaohong 1 month ago
parent
commit
0a7e854006
  1. 7135
      logs/application-test.log
  2. 94
      pom.xml
  3. 27
      src/main/resources/application-dev.yml
  4. 7
      src/main/resources/application-prod.yml
  5. 12
      src/main/resources/application.yml
  6. 6
      src/main/resources/logback-spring.xml
  7. 2
      src/test/java/com/deepchart/integration/ApiSignIntegrationTest.java

7135
logs/application-test.log
File diff suppressed because it is too large
View File

94
pom.xml

@ -1,34 +1,30 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.5.6</version>
<version>3.2.5</version> <!-- 改为 3.2.5,更稳定 -->
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com</groupId>
<!-- 修复 groupId:使用完整的包名 -->
<groupId>com.deepchart</groupId>
<artifactId>deepchart</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>deepchart</name>
<description>全球最懂机构行为的AI</description>
<url/>
<licenses>
<license/>
</licenses>
<developers>
<developer/>
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<packaging>jar</packaging>
<properties>
<java.version>17</java.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- Spring Boot Starters -->
<dependency>
@ -58,6 +54,13 @@
<scope>runtime</scope>
</dependency>
<!-- H2 Database for testing -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
@ -71,11 +74,37 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- 修复 TestNG 依赖 -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
<version>7.8.0</version> <!-- 使用具体版本,不要用 RELEASE -->
<scope>test</scope> <!-- 改为 test scope -->
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>2.0.43</version> <!-- 升级到 2.x 版本 -->
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version> <!-- 升级到最新稳定版 -->
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-annotation</artifactId>
<version>4.4.0</version> <!-- 升级到最新版 -->
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.15.1</version> <!-- 升级到最新版 -->
</dependency>
</dependencies>
@ -93,7 +122,32 @@
</excludes>
</configuration>
</plugin>
<!-- 添加编译插件确保 Java 17 兼容 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.1</version>
<configuration>
<source>17</source>
<target>17</target>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
</path>
</annotationProcessorPaths>
</configuration>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
</project>

27
src/main/resources/application-dev.yml

@ -3,9 +3,9 @@ spring:
activate:
on-profile: dev
datasource:
url: jdbc:mysql://localhost:3306/deepchart?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://39.98.127.73:3306/deepchart?useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username: deepchart
password: 123456
password: itk4paAC8H7CwKrm
driver-class-name: com.mysql.cj.jdbc.Driver
hikari:
maximum-pool-size: 10
@ -17,17 +17,17 @@ spring:
jpa:
hibernate:
ddl-auto: update
show-sql: true
ddl-auto: update #自动更新表结构
show-sql: true #显示执行的SQL
properties:
hibernate:
format_sql: true
dialect: org.hibernate.dialect.MySQL8Dialect
format_sql: true #格式化SQL输出
dialect: org.hibernate.dialect.MySQL8Dialect #指定数据库方言
jdbc:
batch_size: 20
order_inserts: true
order_updates: true
open-in-view: false
batch_size: 20 #批量操作大小
order_inserts: true #排序插入语句
order_updates: true #排序更新语句
open-in-view: false #限制Session生命周期
# 测试环境日志
logging:
@ -37,4 +37,9 @@ logging:
org.hibernate.type: TRACE
org.springframework.web: DEBUG
file:
name: logs/application-test.log
name: logs/application-test.log
# API签名配置
api:
sign:
enabled: false # 开发环境可禁用

7
src/main/resources/application-prod.yml

@ -53,4 +53,9 @@ management:
include: health,info,metrics
endpoint:
health:
show-details: when_authorized
show-details: when_authorized
# API签名配置
api:
sign:
enabled: true

12
src/main/resources/application.yml

@ -9,10 +9,15 @@ spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
# 启用调试模式
debug: true
# 日志配置
logging:
config: classpath:logback-spring.xml
config: classpath:logback-spring.xml
# 服务配置
server:
@ -32,4 +37,5 @@ management:
include: health,info,metrics
endpoint:
health:
show-details: always
show-details: always

6
src/main/resources/logback-spring.xml

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<!-- <include resource="org/springframework/boot/logging/logback/console-appender.xml"/>-->
<!-- 测试环境配置 -->
<springProfile name="test">
<springProfile name="dev">
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/application-test.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>logs/application-test.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<fileNamePattern>logs/application-dev.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>10MB</maxFileSize>
<maxHistory>7</maxHistory>
<totalSizeCap>100MB</totalSizeCap>

2
src/test/java/com/deepchart/integration/ApiSignIntegrationTest.java

@ -23,7 +23,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@SpringBootTest
@AutoConfigureMockMvc
@ActiveProfiles("test")
@ActiveProfiles("dev")
@Transactional
@DisplayName("API签名集成测试")
class ApiSignIntegrationTest {

Loading…
Cancel
Save