diff --git a/.gitignore b/.gitignore index 87be0d8..0e801fd 100644 --- a/.gitignore +++ b/.gitignore @@ -43,4 +43,5 @@ application-test.properties application-s3.properties test_img_dir +/src/main/resources/ **/src/main/resources/secret diff --git a/src/main/java/com/example/moim/config/swagger/SwaggerConfig.java b/src/main/java/com/example/moim/config/swagger/SwaggerConfig.java new file mode 100644 index 0000000..274e8b9 --- /dev/null +++ b/src/main/java/com/example/moim/config/swagger/SwaggerConfig.java @@ -0,0 +1,34 @@ +package com.example.moim.config.swagger; + +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.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class SwaggerConfig { + @Bean + public OpenAPI customOpenAPI() { + SecurityScheme bearerAuthScheme = new SecurityScheme() + .type(SecurityScheme.Type.HTTP) + .scheme("bearer") + .bearerFormat("JWT") + .in(SecurityScheme.In.HEADER) + .name("Authorization"); + + SecurityRequirement securityRequirement = new SecurityRequirement() + .addList("BearerAuth"); + + return new OpenAPI() + .info(new Info() // API 문서의 기본 정보 + .title("MatchDay API") + .description("MatchDay 백엔드 API 문서") + .version("v1.0.0")) + .components(new Components() + .addSecuritySchemes("BearerAuth", bearerAuthScheme)) + .addSecurityItem(securityRequirement); + } +} diff --git a/src/main/java/com/example/moim/match/controller/MatchController.java b/src/main/java/com/example/moim/match/controller/MatchController.java index c179e00..06b955b 100644 --- a/src/main/java/com/example/moim/match/controller/MatchController.java +++ b/src/main/java/com/example/moim/match/controller/MatchController.java @@ -142,7 +142,7 @@ public BaseResponse matchRecordSave(@PathVariable Long matchI } //매치 메인 페이지(대시보드) - @GetMapping("match/main/{clubId}") + @GetMapping("/match/main/{clubId}") public BaseResponse findMatchMain(@PathVariable Long clubId, @AuthenticationPrincipal UserDetailsImpl userDetailsImpl) { return BaseResponse.onSuccess(matchService.matchMainFind(clubId), ResponseCode.OK); } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f606312..a07c1ff 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1 +1 @@ -spring.profiles.include=local, s3 \ No newline at end of file +spring.profiles.include=test, s3 \ No newline at end of file