From 234f674876fda59f263b08c3cecca0588ac0e9cf Mon Sep 17 00:00:00 2001 From: Liu Rui Date: Sat, 28 Sep 2024 21:24:06 +0800 Subject: [PATCH] =?UTF-8?q?config-=E9=87=87=E7=94=A8yml=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- my-boot/build.gradle | 1 + .../src/main/resources/application.properties | 27 ------------ my-boot/src/main/resources/application.yml | 44 +++++++++++++++++++ .../src/test/resources/application.properties | 2 - my-boot/src/test/resources/application.yml | 6 +++ 5 files changed, 51 insertions(+), 29 deletions(-) delete mode 100644 my-boot/src/main/resources/application.properties create mode 100644 my-boot/src/main/resources/application.yml delete mode 100644 my-boot/src/test/resources/application.properties create mode 100644 my-boot/src/test/resources/application.yml diff --git a/my-boot/build.gradle b/my-boot/build.gradle index e468cb0c..e8924000 100644 --- a/my-boot/build.gradle +++ b/my-boot/build.gradle @@ -10,6 +10,7 @@ tasks.named('compileJava').configure { dependencies { implementation enforcedPlatform(libs.quarkus.platform.bom) + implementation "io.quarkus:quarkus-config-yaml" implementation project(":my-core") implementation project(':my-database-std') implementation project(":my-authorization") diff --git a/my-boot/src/main/resources/application.properties b/my-boot/src/main/resources/application.properties deleted file mode 100644 index 9107f923..00000000 --- a/my-boot/src/main/resources/application.properties +++ /dev/null @@ -1,27 +0,0 @@ -server.debug=false -quarkus.http.port=8080 -#quarkus.http.root-path=/api -quarkus.rest.path=/api - -quarkus.datasource.db-kind=postgresql -quarkus.datasource.username=postgres -quarkus.datasource.password=muyun2024 -quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:54324/muyun -#quarkus.datasource.reactive.url=vertx-reactive:postgresql://localhost:54324/muyun -quarkus.datasource.jdbc=true -quarkus.banner.path=banner.txt -quarkus.management.enable-compression=true - -quarkus.log.category."org.jdbi".level=DEBUG - -quarkus.log.level=INFO -quarkus.log.console.enable=true -quarkus.log.console.format=%d{yyyy-MM-dd HH:mm:ss} %-5p [%c{3.}] (%t) %s%e%n -quarkus.log.file.enable=false -quarkus.log.file.path=logs/muyun.log -quarkus.log.file.level=DEBUG -quarkus.log.file.format=%d{yyyy-MM-dd HH:mm:ss} %-5p [%c{3.}] (%t) %s%e%n - -quarkus.log.file.rotation.max-file-count=7 -quarkus.log.file.rotation.file-suffix=.yyyy-MM-dd -quarkus.log.file.rotation.rotate-on-boot=true diff --git a/my-boot/src/main/resources/application.yml b/my-boot/src/main/resources/application.yml new file mode 100644 index 00000000..0e06ffe5 --- /dev/null +++ b/my-boot/src/main/resources/application.yml @@ -0,0 +1,44 @@ +server: + debug: false + +quarkus: + http: + port: 8080 + # root-path: /api + rest: + path: /api + + datasource: + db-kind: postgresql + username: postgres + password: muyun2024 + jdbc: + url: jdbc:postgresql://localhost:54324/muyun + enabled: true + # reactive: + # url: vertx-reactive:postgresql://localhost:54324/muyun + + banner: + path: banner.txt + + management: + enable-compression: true + + log: + category: + "org.jdbi": + level: DEBUG + + level: INFO + console: + enable: true + format: "%d{yyyy-MM-dd HH:mm:ss} %-5p [%c{3.}] (%t) %s%e%n" + file: + enable: false + path: logs/muyun.log + level: DEBUG + format: "%d{yyyy-MM-dd HH:mm:ss} %-5p [%c{3.}] (%t) %s%e%n" + rotation: + max-file-count: 7 + file-suffix: .yyyy-MM-dd + rotate-on-boot: true diff --git a/my-boot/src/test/resources/application.properties b/my-boot/src/test/resources/application.properties deleted file mode 100644 index d440b791..00000000 --- a/my-boot/src/test/resources/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -server.debug=true -quarkus.rest.path=/ diff --git a/my-boot/src/test/resources/application.yml b/my-boot/src/test/resources/application.yml new file mode 100644 index 00000000..eab96abf --- /dev/null +++ b/my-boot/src/test/resources/application.yml @@ -0,0 +1,6 @@ +server: + debug: true + +quarkus: + rest: + path: /