-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from TravelCompass-UMC/refactor/90
[#90] 배포 도메인 변경
- Loading branch information
Showing
7 changed files
with
47 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 44 additions & 5 deletions
49
src/main/java/com/travelcompass/api/global/config/SwaggerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,60 @@ | ||
package com.travelcompass.api.global.config; | ||
|
||
import io.swagger.v3.oas.models.Components; | ||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.info.Info; | ||
import io.swagger.v3.oas.models.security.SecurityRequirement; | ||
import io.swagger.v3.oas.models.security.SecurityScheme; | ||
import org.springdoc.core.models.GroupedOpenApi; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
@Configuration | ||
public class SwaggerConfig { | ||
@Bean | ||
public OpenAPI openAPI() { | ||
public OpenAPI api() { | ||
Info info = new Info() | ||
.version("v1.0.0") | ||
.title("Travel Compass API") | ||
.description("Travel Compass API 명세서") | ||
.version("v1.0.0"); | ||
.description("Travel Compass API 명세서"); | ||
|
||
|
||
// SecuritySecheme명 | ||
String jwtSchemeName = "AccessToken"; | ||
// API 요청헤더에 인증정보 포함 | ||
SecurityRequirement securityRequirement = new SecurityRequirement().addList(jwtSchemeName); | ||
// SecuritySchemes 등록 | ||
Components components = new Components() | ||
.addSecuritySchemes(jwtSchemeName, new SecurityScheme() | ||
.name(jwtSchemeName) | ||
.type(SecurityScheme.Type.HTTP) // HTTP 방식 | ||
.scheme("bearer") | ||
.bearerFormat("JWT")); // 토큰 형식을 지정하는 임의의 문자(Optional | ||
|
||
return new OpenAPI() | ||
.components(new io.swagger.v3.oas.models.Components()) | ||
.info(info); | ||
.info(info) | ||
.addSecurityItem(securityRequirement) | ||
.components(components); | ||
} | ||
|
||
@Bean | ||
public GroupedOpenApi allGroup(){ | ||
return GroupedOpenApi.builder() | ||
.group("All") | ||
.pathsToMatch("/**") | ||
.build(); | ||
} | ||
|
||
// CORS 설정 추가 | ||
@Bean | ||
public WebMvcConfigurer corsConfigurer() { | ||
return new WebMvcConfigurer() { | ||
@Override | ||
public void addCorsMappings(CorsRegistry registry) { | ||
registry.addMapping("/**").allowedOrigins("*").allowedMethods("GET", "POST", "PUT", "DELETE"); | ||
} | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
src/main/java/com/travelcompass/api/oauth/repository/RefreshTokenRedisRepository.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters