File tree Expand file tree Collapse file tree 6 files changed +53
-0
lines changed Expand file tree Collapse file tree 6 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ dependencies {
2828 implementation(" org.springframework.boot:spring-boot-starter-data-jpa" )
2929 implementation(" org.springframework.boot:spring-boot-starter-validation" )
3030 implementation(" org.springframework.boot:spring-boot-starter-web" )
31+ implementation(" org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0" )
3132 compileOnly(" org.projectlombok:lombok" )
3233 developmentOnly(" org.springframework.boot:spring-boot-devtools" )
3334 runtimeOnly(" com.h2database:h2" )
Original file line number Diff line number Diff line change 22
33import org .springframework .boot .SpringApplication ;
44import org .springframework .boot .autoconfigure .SpringBootApplication ;
5+ import org .springframework .scheduling .annotation .EnableScheduling ;
56
67@ SpringBootApplication
8+ @ EnableScheduling
79public class BackApplication {
810
911 public static void main (String [] args ) {
Original file line number Diff line number Diff line change 1+ package com .back .global .appConfig ;
2+
3+ import io .swagger .v3 .oas .models .OpenAPI ;
4+ import io .swagger .v3 .oas .models .info .Info ;
5+ import org .springframework .context .annotation .Bean ;
6+ import org .springframework .context .annotation .Configuration ;
7+
8+ @ Configuration
9+ public class SwaggerConfig {
10+
11+ @ Bean
12+ public OpenAPI openAPI () {
13+ return new OpenAPI ()
14+ .info (new Info ()
15+ .title ("HaeDokCoding API" )
16+ .description ("HaeDokCoding Backend API Documentation" )
17+ .version ("v1.0.0" ));
18+ }
19+ }
Original file line number Diff line number Diff line change 1+ package com .back .global .controller ;
2+
3+ import org .springframework .stereotype .Controller ;
4+ import org .springframework .web .bind .annotation .GetMapping ;
5+
6+ @ Controller
7+ public class HomeController {
8+
9+ @ GetMapping ("/" )
10+ public String redirectToSwagger () {
11+ return "redirect:/swagger-ui/index.html" ;
12+ }
13+ }
Original file line number Diff line number Diff line change @@ -22,6 +22,14 @@ spring:
2222 format_sql : true
2323 show_sql : true
2424
25+ # Swagger 설정
26+ springdoc :
27+ api-docs :
28+ path : /api-docs
29+ swagger-ui :
30+ path : /swagger-ui.html
31+ operationsSorter : method
32+
2533# # AI 설정
2634# ai:
2735# openai:
Original file line number Diff line number Diff line change 44 username : sa
55 password :
66 driver-class-name : org.h2.Driver
7+
8+ # JPA 설정
9+ jpa :
10+ database-platform : org.hibernate.dialect.H2Dialect
11+ hibernate :
12+ ddl-auto : create-drop # 테스트용: 시작할 때 테이블 생성, 종료할 때 삭제
13+ properties :
14+ hibernate :
15+ format_sql : true
16+ show_sql : false # 테스트에서는 SQL 로그 비활성화
You can’t perform that action at this time.
0 commit comments