1- package com .example .smartair .config ;
1+ package com .example .enjoy .config ;
22
33import io .swagger .v3 .oas .models .OpenAPI ;
44import io .swagger .v3 .oas .models .info .Info ;
1414public class SwaggerConfig {
1515 @ Bean
1616 public OpenAPI customOpenAPI () {
17- // Security Scheme 정의
18- SecurityScheme securityScheme = new SecurityScheme ()
19- .type (SecurityScheme .Type .HTTP )
20- .scheme ("bearer" )
21- .bearerFormat ("JWT" )
17+ // API Key Scheme 정의
18+ SecurityScheme apiKeyScheme = new SecurityScheme ()
19+ .type (SecurityScheme .Type .APIKEY )
2220 .in (SecurityScheme .In .HEADER )
23- .name ("Authorization" );
21+ .name ("Authorization" )
22+ .description ("인증을 위한 토큰" );
2423
2524 // Security Requirement 정의
26- SecurityRequirement securityRequirement = new SecurityRequirement ().addList ("BearerAuth " );
25+ SecurityRequirement securityRequirement = new SecurityRequirement ().addList ("ApiKeyAuth " );
2726
28- // 서버 목록 정의
27+ // 서버 정의
2928 Server localServer = new Server ();
3029 localServer .setUrl ("http://localhost:8080" );
31- localServer .setDescription ("Local server (HTTP) " );
30+ localServer .setDescription ("Local Server " );
3231
33- Server prodServer = new Server ();
34- prodServer .setUrl ("https ://smartair.site " );
35- prodServer .setDescription ("Production server (HTTPS) " );
32+ Server apiServer = new Server ();
33+ apiServer .setUrl ("http ://3.36.34.67:8080 " );
34+ apiServer .setDescription ("API Server " );
3635
3736 return new OpenAPI ()
3837 .info (new Info ().title ("Enjoy Hack API" )
3938 .description ("EnjoyHack Application API Documentation" )
4039 .version ("v1.0" ))
41- .addSecurityItem (securityRequirement ) // Security Requirement 추가
42- .schemaRequirement ("BearerAuth " , securityScheme ) // Security Scheme 추가
43- .servers (List .of (localServer , prodServer )); // 서버 목록 추가
40+ .addSecurityItem (securityRequirement )
41+ .schemaRequirement ("ApiKeyAuth " , apiKeyScheme )
42+ .servers (List .of (localServer , apiServer )); // 로컬서버와 운영서버 모두 등록
4443 }
45-
46- }
44+ }
0 commit comments