From 8bdd0182906332e6a0d5dc927a539814a6e7a922 Mon Sep 17 00:00:00 2001 From: DDonghyeo Date: Thu, 9 May 2024 17:55:40 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs=20:=20API=20=EB=AC=B8?= =?UTF-8?q?=EC=84=9C=20=ED=86=B5=ED=95=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noti-service/build.gradle | 15 ++++++++++++++- noti-service/src/main/resources/bootstrap.yml | 4 ++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/noti-service/build.gradle b/noti-service/build.gradle index 6ec52452..15cb6425 100644 --- a/noti-service/build.gradle +++ b/noti-service/build.gradle @@ -2,6 +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' } group = 'com.waither' @@ -48,14 +49,26 @@ dependencies { //Redis implementation 'org.springframework.boot:spring-boot-starter-data-redis' - //Swagger + //Springdoc implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.1.0' + //implementation 'org.springdoc:springdoc-openapi-gradle-plugin:1.8.0' //JUnit + AssertJ testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2' 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") + } +} + dependencyManagement { imports { mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" diff --git a/noti-service/src/main/resources/bootstrap.yml b/noti-service/src/main/resources/bootstrap.yml index a2f1e679..8b8a5d64 100644 --- a/noti-service/src/main/resources/bootstrap.yml +++ b/noti-service/src/main/resources/bootstrap.yml @@ -9,7 +9,7 @@ spring: cloud: config: uri: http://localhost:8888 - name: database-noti,redis + name: database-noti,redis,apiDocs-noti kafka: bootstrap-servers: "localhost:9092" @@ -19,4 +19,4 @@ 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