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:
@@ -1,14 +1,26 @@
|
|||||||
spring:
|
spring:
|
||||||
|
cache:
|
||||||
|
type: none
|
||||||
r2dbc:
|
r2dbc:
|
||||||
url: r2dbc:postgresql://localhost:55432/manage_system
|
url: r2dbc:postgresql://localhost:55432/manage_system
|
||||||
username: novalon
|
username: novalon
|
||||||
password: novalon123
|
password: novalon123
|
||||||
|
pool:
|
||||||
|
initial-size: 5
|
||||||
|
max-size: 20
|
||||||
|
max-idle-time: 10m
|
||||||
|
max-life-time: 30m
|
||||||
|
acquire-timeout: 3s
|
||||||
flyway:
|
flyway:
|
||||||
enabled: true
|
enabled: true
|
||||||
locations: classpath:db/migration
|
locations: classpath:db/migration
|
||||||
baseline-on-migrate: true
|
baseline-on-migrate: true
|
||||||
validate-on-migrate: true
|
validate-on-migrate: true
|
||||||
|
|
||||||
|
jwt:
|
||||||
|
secret: novalon-novalon-manage-jwt-secret-key-for-development-only-2026
|
||||||
|
expiration: 86400000
|
||||||
|
|
||||||
rate:
|
rate:
|
||||||
limit:
|
limit:
|
||||||
limit-for-period: 10000
|
limit-for-period: 10000
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ spring:
|
|||||||
r2dbc:
|
r2dbc:
|
||||||
url: r2dbc:postgresql://localhost:55432/manage_system
|
url: r2dbc:postgresql://localhost:55432/manage_system
|
||||||
username: novalon
|
username: novalon
|
||||||
password: novalon123
|
password: 123456
|
||||||
pool:
|
pool:
|
||||||
initial-size: 5
|
initial-size: 5
|
||||||
max-size: 20
|
max-size: 20
|
||||||
@@ -16,7 +16,7 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
url: jdbc:postgresql://localhost:55432/manage_system
|
url: jdbc:postgresql://localhost:55432/manage_system
|
||||||
username: novalon
|
username: novalon
|
||||||
password: novalon123
|
password: 123456
|
||||||
driver-class-name: org.postgresql.Driver
|
driver-class-name: org.postgresql.Driver
|
||||||
flyway:
|
flyway:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -31,6 +31,10 @@ spring:
|
|||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
cn.novalon.manage: DEBUG
|
cn.novalon.manage: DEBUG
|
||||||
|
cn.novalon.novalon.manage: DEBUG
|
||||||
|
cn.novalon.novalon.manage.sys.audit: DEBUG
|
||||||
org.springframework.r2dbc: DEBUG
|
org.springframework.r2dbc: DEBUG
|
||||||
cn.novalon.manage.db: DEBUG
|
cn.novalon.manage.db: DEBUG
|
||||||
org.flywaydb: DEBUG
|
org.flywaydb: DEBUG
|
||||||
|
|
||||||
|
debug: true
|
||||||
@@ -2,8 +2,17 @@ server:
|
|||||||
port: 8084
|
port: 8084
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
|
aop:
|
||||||
|
proxy-target-class: true
|
||||||
application:
|
application:
|
||||||
name: manage-app
|
name: manage-app
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
cache:
|
||||||
|
type: none
|
||||||
|
autoconfigure:
|
||||||
|
exclude:
|
||||||
|
- org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration
|
||||||
r2dbc:
|
r2dbc:
|
||||||
url: r2dbc:postgresql://${DB_HOST:localhost}:${DB_PORT:55432}/${DB_NAME:manage_system}
|
url: r2dbc:postgresql://${DB_HOST:localhost}:${DB_PORT:55432}/${DB_NAME:manage_system}
|
||||||
username: ${DB_USERNAME:postgres}
|
username: ${DB_USERNAME:postgres}
|
||||||
@@ -65,4 +74,4 @@ springdoc:
|
|||||||
operations-sorter: alpha
|
operations-sorter: alpha
|
||||||
show-actuator: false
|
show-actuator: false
|
||||||
default-consumes-media-type: application/json
|
default-consumes-media-type: application/json
|
||||||
default-produces-media-type: application/json
|
default-produces-media-type: application/json
|
||||||
+5
-2
@@ -14,7 +14,10 @@ import reactor.test.StepVerifier;
|
|||||||
* @author 张翔
|
* @author 张翔
|
||||||
* @date 2026-04-03
|
* @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")
|
@ActiveProfiles("test")
|
||||||
class ManualTableCreationTest {
|
class ManualTableCreationTest {
|
||||||
|
|
||||||
@@ -25,7 +28,7 @@ class ManualTableCreationTest {
|
|||||||
void setUp() {
|
void setUp() {
|
||||||
r2dbcEntityTemplate.getDatabaseClient()
|
r2dbcEntityTemplate.getDatabaseClient()
|
||||||
.sql("CREATE TABLE IF NOT EXISTS operation_log (" +
|
.sql("CREATE TABLE IF NOT EXISTS operation_log (" +
|
||||||
"id BIGINT AUTO_INCREMENT PRIMARY KEY, " +
|
"id BIGSERIAL PRIMARY KEY, " +
|
||||||
"username VARCHAR(50), " +
|
"username VARCHAR(50), " +
|
||||||
"operation VARCHAR(100), " +
|
"operation VARCHAR(100), " +
|
||||||
"method VARCHAR(200), " +
|
"method VARCHAR(200), " +
|
||||||
|
|||||||
Reference in New Issue
Block a user