From 6ad1258815121e3f7ac3ffc3c8fea335d507b46d Mon Sep 17 00:00:00 2001 From: DDonghyeo Date: Mon, 27 May 2024 23:11:04 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=93=9Ddocs=20:=20bootstrap.yml=20spri?= =?UTF-8?q?ngdoc=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap.yml | 26 ++++++++++++++++--- noti-service/src/main/resources/bootstrap.yml | 13 ++++++++-- user-service/src/main/resources/bootstrap.yml | 13 ++++++++-- .../src/main/resources/bootstrap.yml | 21 ++++++++++----- 4 files changed, 60 insertions(+), 13 deletions(-) diff --git a/apiGateway-service/src/main/resources/bootstrap.yml b/apiGateway-service/src/main/resources/bootstrap.yml index f36f218a..f0febf9d 100644 --- a/apiGateway-service/src/main/resources/bootstrap.yml +++ b/apiGateway-service/src/main/resources/bootstrap.yml @@ -1,5 +1,5 @@ server: - port: 80 + port: 443 spring: application: @@ -8,7 +8,7 @@ spring: active: dev cloud: config: - uri: http://config:8888 + uri: http://localhost:8888 name: database-apiGateway, redis, jwt kafka: bootstrap-servers: "localhost:9092" @@ -22,8 +22,28 @@ eureka: service-url: defaultZone: http://localhost:8761/eureka + +springdoc: +# api-docs: +# enabled: true +# version: openapi_3_0 + swagger-ui: + use-root-path: true + urls: + - url: /noti/v3/api-docs + name: Notification Service + - url: /weather/v3/api-docs + name: Weather Service + - url: /user/v3/api-docs + name: User Service +# path: /swagger-ui.html +# version: 3.0.0 + + + #management: # Actuator Settings # endpoints: # web: # exposure: -# include: refresh, health, beans, httptrace \ No newline at end of file +# include: refresh, health, beans, httptrace + diff --git a/noti-service/src/main/resources/bootstrap.yml b/noti-service/src/main/resources/bootstrap.yml index 71055d41..06c6289f 100644 --- a/noti-service/src/main/resources/bootstrap.yml +++ b/noti-service/src/main/resources/bootstrap.yml @@ -8,7 +8,7 @@ spring: active: dev cloud: config: - uri: http://config:8888 + uri: http://localhost:8888 name: database-noti,redis kafka: bootstrap-servers: "localhost:9092" @@ -19,4 +19,13 @@ eureka: register-with-eureka: true # register to eureka server fetch-registry: true # Getting instances' information from eureka server service-url: - defaultZone : http://127.0.0.1:8761/eureka #Eureka Server's address \ No newline at end of file + defaultZone : http://127.0.0.1:8761/eureka #Eureka Server's address + +springdoc: + api-docs: + version: openapi_3_0 + enabled: true + path: /noti/v3/api-docs + default-consumes-media-type: application/json + default-produces-media-type: application/json + enable-spring-security: true diff --git a/user-service/src/main/resources/bootstrap.yml b/user-service/src/main/resources/bootstrap.yml index c7977aa7..42f104cc 100644 --- a/user-service/src/main/resources/bootstrap.yml +++ b/user-service/src/main/resources/bootstrap.yml @@ -8,7 +8,7 @@ spring: active: dev cloud: config: - uri: http://config:8888 + uri: http://localhost:8888 name: database-user,redis, jwt, smtp, apiDocs-user kafka: bootstrap-servers: "localhost:9092" @@ -27,4 +27,13 @@ eureka: # endpoints: # web: # exposure: -# include: busrefresh \ No newline at end of file +# include: busrefresh + +springdoc: + api-docs: + version: openapi_3_0 + enabled: true + path: /user/v3/api-docs + default-consumes-media-type: application/json + default-produces-media-type: application/json + enable-spring-security: true \ No newline at end of file diff --git a/weather-service/src/main/resources/bootstrap.yml b/weather-service/src/main/resources/bootstrap.yml index 4abbfad6..e748072c 100644 --- a/weather-service/src/main/resources/bootstrap.yml +++ b/weather-service/src/main/resources/bootstrap.yml @@ -8,7 +8,7 @@ spring: active: dev cloud: config: - uri: http://config:8888 + uri: http://localhost:8888 name: database-weather kafka: bootstrap-servers: "localhost:9092" @@ -23,8 +23,17 @@ eureka: service-url: defaultZone : http://127.0.0.1:8761/eureka #Eureka Server's address -management: # Actuator - endpoints: - web: - exposure: - include: busrefresh \ No newline at end of file +#management: # Actuator +# endpoints: +# web: +# exposure: +# include: busrefresh + +springdoc: + api-docs: + version: openapi_3_0 + enabled: true + path: /noti/v3/api-docs + default-consumes-media-type: application/json + default-produces-media-type: application/json + enable-spring-security: true \ No newline at end of file From 3adb3589909a621746ee7746b8b6daf4537cae3d Mon Sep 17 00:00:00 2001 From: DDonghyeo Date: Mon, 27 May 2024 23:11:19 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=93=9Ddocs=20:=20springdoc=20?= =?UTF-8?q?=EC=9D=98=EC=A1=B4=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apiGateway-service/build.gradle | 2 ++ noti-service/build.gradle | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/apiGateway-service/build.gradle b/apiGateway-service/build.gradle index a394c8d4..884135da 100644 --- a/apiGateway-service/build.gradle +++ b/apiGateway-service/build.gradle @@ -56,6 +56,8 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-security' testImplementation 'org.springframework.security:spring-security-test' + // Swagger + implementation 'org.springdoc:springdoc-openapi-starter-webflux-ui:2.1.0' // //Spring Boot Actuator // implementation 'org.springframework.boot:spring-boot-starter-actuator' diff --git a/noti-service/build.gradle b/noti-service/build.gradle index 5f7e2ca0..ae41b641 100644 --- a/noti-service/build.gradle +++ b/noti-service/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java' id 'org.springframework.boot' version '3.2.3' id 'io.spring.dependency-management' version '1.1.4' - id "org.springdoc.openapi-gradle-plugin" version '1.8.0' +// id "org.springdoc.openapi-gradle-plugin" version '1.8.0' } group = 'com.waither' @@ -62,16 +62,16 @@ dependencies { testImplementation 'org.assertj:assertj-core:3.23.1' } -openApi { - apiDocsUrl.set("http://localhost:80") // Document URL - outputDir.set(file("$rootDir/build/docs")) // Build Result Path - outputFileName.set("noti.json") // Build Result File Name - groupedApiMappings.set(Map.of("http://localhost:8082/noti/api-docs", "noti.json")) - waitTimeInSeconds.set(60) // Timeout - customBootRun { - args.add("--spring.profiles.active=dev") - } -} +//openApi { +// apiDocsUrl.set("http://localhost:80") // Document URL +// outputDir.set(file("$rootDir/build/docs")) // Build Result Path +// outputFileName.set("noti.json") // Build Result File Name +// groupedApiMappings.set(Map.of("http://localhost:8082/noti/api-docs", "noti.json")) +// waitTimeInSeconds.set(60) // Timeout +// customBootRun { +// args.add("--spring.profiles.active=dev") +// } +//} dependencyManagement { imports { From d845562269330b9378c6a5a3eae44682a3091b28 Mon Sep 17 00:00:00 2001 From: DDonghyeo Date: Mon, 27 May 2024 23:11:28 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=9Ddocs=20:=20Dockerfile=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apiGateway-service/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/apiGateway-service/Dockerfile b/apiGateway-service/Dockerfile index 119a7cac..856b48b4 100644 --- a/apiGateway-service/Dockerfile +++ b/apiGateway-service/Dockerfile @@ -2,4 +2,5 @@ FROM openjdk:17-jdk ARG JAR_FILE=build/libs/*.jar COPY ${JAR_FILE} app.jar +COPY src/main/resources/static /app/static ENTRYPOINT ["java", "-Dspring.profiles.active=prod", "-Duser.timezone=Asia/Seoul" , "-jar", "app.jar"]