Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,11 @@ out/
.vscode/

# .env
.env
.env

# 민감한 설정 파일
src/main/resources/application-local.yml
src/main/resources/application-prod.yml

# EC2 키 페어
*.pem
Empty file modified gradlew
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.springframework.web.bind.annotation.*;

@Tag(name = "User API", description = "유저 관련 API") // Swagger에서 이 컨트롤러를 "User API" 그룹으로 묶어줘요
@RestController // REST API 컨트롤러임을 선언해요
@RestController // REST API 컨트롤러임을 선언해요
@RequestMapping("/users") // 이 컨트롤러의 모든 API는 /users로 시작해요
public class UserController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@

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

@Configuration
public class SwaggerConfig {

@Value("${swagger.title}")
private String swaggerTitle;

@Value("${swagger.description}")
private String swaggerDescription;

@Bean
public OpenAPI openAPI() {
return new OpenAPI()
.info(new Info()
.title("My API") // 문서 제목
.description("스터디 실습용 API 문서") // 설명
.version("v1.0.0")); // 버전
.title(swaggerTitle)
.description(swaggerDescription));
}
}
3 changes: 3 additions & 0 deletions src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
swagger:
title: "Workbook API (LOCAL)"
description: "로컬 개발 환경입니다."
3 changes: 3 additions & 0 deletions src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
swagger:
title: ${SWAGGER_TITLE}
description: ${SWAGGER_DESCRIPTION}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
spring:
application:
name: workbook
profiles:
active: local