feat(app): 迁移 manage-app 模块配置与测试(任务 T3.4)

- 替换 application*.yml 配置文件,适配应用名 manage-app
- 新增 aop/cache/autoconfigure 配置
- 删除并复制测试文件,替换包名 cn.novalon.gym.manage → cn.novalon.manage
- 替换测试配置 application-test.yml
- 编译验证通过
This commit is contained in:
张翔
2026-04-27 14:40:03 +08:00
parent 088a528af5
commit f18e904e65
4 changed files with 34 additions and 6 deletions
@@ -1,14 +1,26 @@
spring:
cache:
type: none
r2dbc:
url: r2dbc:postgresql://localhost:55432/manage_system
username: novalon
password: novalon123
pool:
initial-size: 5
max-size: 20
max-idle-time: 10m
max-life-time: 30m
acquire-timeout: 3s
flyway:
enabled: true
locations: classpath:db/migration
baseline-on-migrate: true
validate-on-migrate: true
jwt:
secret: novalon-novalon-manage-jwt-secret-key-for-development-only-2026
expiration: 86400000
rate:
limit:
limit-for-period: 10000
@@ -6,7 +6,7 @@ spring:
r2dbc:
url: r2dbc:postgresql://localhost:55432/manage_system
username: novalon
password: novalon123
password: 123456
pool:
initial-size: 5
max-size: 20
@@ -16,7 +16,7 @@ spring:
datasource:
url: jdbc:postgresql://localhost:55432/manage_system
username: novalon
password: novalon123
password: 123456
driver-class-name: org.postgresql.Driver
flyway:
enabled: true
@@ -31,6 +31,10 @@ spring:
logging:
level:
cn.novalon.manage: DEBUG
cn.novalon.novalon.manage: DEBUG
cn.novalon.novalon.manage.sys.audit: DEBUG
org.springframework.r2dbc: DEBUG
cn.novalon.manage.db: DEBUG
org.flywaydb: DEBUG
org.flywaydb: DEBUG
debug: true
@@ -2,8 +2,17 @@ server:
port: 8084
spring:
aop:
proxy-target-class: true
application:
name: manage-app
main:
allow-bean-definition-overriding: true
cache:
type: none
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration
r2dbc:
url: r2dbc:postgresql://${DB_HOST:localhost}:${DB_PORT:55432}/${DB_NAME:manage_system}
username: ${DB_USERNAME:postgres}
@@ -65,4 +74,4 @@ springdoc:
operations-sorter: alpha
show-actuator: false
default-consumes-media-type: application/json
default-produces-media-type: application/json
default-produces-media-type: application/json
@@ -14,7 +14,10 @@ import reactor.test.StepVerifier;
* @author 张翔
* @date 2026-04-03
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
classes = cn.novalon.manage.app.ManageApplication.class
)
@ActiveProfiles("test")
class ManualTableCreationTest {
@@ -25,7 +28,7 @@ class ManualTableCreationTest {
void setUp() {
r2dbcEntityTemplate.getDatabaseClient()
.sql("CREATE TABLE IF NOT EXISTS operation_log (" +
"id BIGINT AUTO_INCREMENT PRIMARY KEY, " +
"id BIGSERIAL PRIMARY KEY, " +
"username VARCHAR(50), " +
"operation VARCHAR(100), " +
"method VARCHAR(200), " +