Merged
sohot8653 merged 5 commits from 2025081301 into main 2025-08-13 15:41:09 +09:00
4 changed files with 67 additions and 1 deletions
Showing only changes of commit e0e868a282 - Show all commits

View File

@@ -8,6 +8,7 @@
- **Security**: Spring Security + JWT
- **Build Tool**: Gradle
- **Container**: Docker + Kubernetes
- **API Documentation**: Swagger (SpringDoc OpenAPI)
## 개발 가이드
@@ -31,7 +32,30 @@ src/main/java/com/bio/bio_backend/
└── BioBackendApplication.java
```
### 2. 트랜잭션 관리
### 2. API 문서화 (Swagger)
#### Swagger UI 접속
- **URL**: `http://localhost:8080/service/swagger-ui.html`
- **API Docs**: `http://localhost:8080/service/api-docs`
#### 주요 어노테이션
```java
@Tag(name = "Member", description = "회원 관리 API")
@Operation(summary = "회원 가입", description = "새로운 회원을 등록합니다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "201", description = "회원 가입 성공"),
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터")
})
```
#### 설정 파일
- **SwaggerConfig.java**: OpenAPI 기본 정보 설정
- **application.properties**: Swagger UI 커스터마이징
### 3. 트랜잭션 관리
#### 기본 설정

View File

@@ -61,6 +61,9 @@ dependencies {
// p6spy
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.9.0'
// SpringDoc OpenAPI (Swagger)
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.9'
}
tasks.named('test') {

View File

@@ -0,0 +1,31 @@
package com.bio.bio_backend.global.config;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.servers.Server;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.List;
@Configuration
public class SwaggerConfig {
@Bean
public OpenAPI openAPI() {
return new OpenAPI()
.info(new Info()
.title("대상 미생물 분석 시스템 Backend API")
.description("대상 미생물 분석 시스템 Backend 서비스의 REST API 문서")
.version("v1.0.0")
.license(new License()
.name("STAM License")
.url("https://stam.kr/")))
.servers(List.of(
new Server().url("http://localhost:8080/service").description("Local Development Server"),
new Server().url("https://api.bio.com/service").description("Production Server")
));
}
}

View File

@@ -54,3 +54,11 @@ token.expiration_time_access=180000
token.expiration_time_refresh=604800000
token.secret_key= c3RhbV9qd3Rfc2VjcmV0X3Rva2Vuc3RhbV9qd3Rfc2VjcmV0X3Rva2Vu
# Swagger 설정
springdoc.api-docs.path=/api-docs
springdoc.swagger-ui.path=/swagger-ui.html
springdoc.swagger-ui.operationsSorter=method
springdoc.swagger-ui.tagsSorter=alpha
springdoc.swagger-ui.doc-expansion=none
springdoc.swagger-ui.disable-swagger-default-url=true