Skip to content

Commit

Permalink
feat: swagger 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
EOTAEGYU committed Nov 14, 2024
1 parent 00c740d commit 5646279
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions 2024-UCD_WEB_SERVER/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies {
// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'


testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.formLogin(formLogin -> formLogin.disable())
.httpBasic(httpBasic -> httpBasic.disable())
.authorizeHttpRequests(auth -> auth
.requestMatchers("/api/users/login", "/", "/api/users/signup").permitAll() // 이 경로에 대한 접근 허용
.requestMatchers("/api-docs/**", "/swagger-ui/**", "/swagger-ui.html","/api/users/login", "/", "/api/users/signup").permitAll() // 이 경로에 대한 접근 허용
.requestMatchers("/api/organizations/**", "/api/channels/**", "/api/users/me/**","/api/users/home").hasRole("ADMIN") // ADMIN 가진 사용자만 접속 가능
.anyRequest().authenticated())
.sessionManagement(session -> session
Expand Down
3 changes: 3 additions & 0 deletions 2024-UCD_WEB_SERVER/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
springdoc.api-docs.enabled=true
springdoc.swagger-ui.enabled=true

springdoc.api-docs.path=/api-docs
springdoc.swagger-ui.path=/swagger-ui.html

spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
Expand Down

0 comments on commit 5646279

Please sign in to comment.