Skip to content

Commit

Permalink
Merge pull request #24 from Team-Going/feature/23
Browse files Browse the repository at this point in the history
[chore] Swagger 세팅
  • Loading branch information
SunwoongH authored Jan 7, 2024
2 parents 84e8ce7 + aadc2ee commit cfbec0c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
5 changes: 3 additions & 2 deletions doorip-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ dependencies {
implementation group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
implementation "org.flywaydb:flyway-core"
implementation "org.flywaydb:flyway-mysql"
implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-mysql'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'
implementation project(path: ':doorip-domain')
implementation project(path: ':doorip-external')
implementation project(path: ':doorip-common')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class SecurityConfig {
private final JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint;
private final JwtValidator jwtValidator;
private final JwtProvider jwtProvider;

private static final String[] whiteList = {"/api/users/signin", "/api/users/signup", "/api/users/reissue", "/"};
private static final String[] whiteList = {"/api/users/signin", "/api/users/signup", "/api/users/reissue",
"/", "/swagger-ui/**", "/error", "/v3/api-docs/**"};

@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
package org.doorip.common;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "health check", description = "health check API")
@RequestMapping("/")
@RestController
public class HealthCheckApiController {
@Operation(summary = "health check API", description = "health check API 입니다.")
@ApiResponse(
responseCode = "200",
description = "요청이 성공했습니다.",
content = @Content(schema = @Schema(implementation = String.class))
)
@GetMapping
public String healthCheck() {
return "doorip spring boot server ok!";
Expand Down
21 changes: 21 additions & 0 deletions doorip-api/src/main/java/org/doorip/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.doorip.config;

import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {
@Bean
public OpenAPI api() {
Info info = new Info()
.title("Doorip API Docs")
.version("v1.0")
.description("Doorip 서비스 API 명세서 입니다.");
return new OpenAPI()
.components(new Components())
.info(info);
}
}

0 comments on commit cfbec0c

Please sign in to comment.