mirror of https://github.com/halo-dev/halo
Add support for API documentation (#2082)
parent
b4e9b54ffe
commit
3cf2f9d7e1
|
@ -55,6 +55,8 @@ dependencies {
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||||
implementation "org.springframework.boot:spring-boot-starter-jetty"
|
implementation "org.springframework.boot:spring-boot-starter-jetty"
|
||||||
|
|
||||||
|
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.0-M2'
|
||||||
implementation "org.flywaydb:flyway-core"
|
implementation "org.flywaydb:flyway-core"
|
||||||
implementation "org.flywaydb:flyway-mysql"
|
implementation "org.flywaydb:flyway-mysql"
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,10 @@ public class WebSecurityConfig {
|
||||||
http
|
http
|
||||||
.authorizeHttpRequests((authorize) -> authorize
|
.authorizeHttpRequests((authorize) -> authorize
|
||||||
.antMatchers(providerSettings.getTokenEndpoint()).permitAll()
|
.antMatchers(providerSettings.getTokenEndpoint()).permitAll()
|
||||||
|
// for static path
|
||||||
.antMatchers("/static/js/**").permitAll()
|
.antMatchers("/static/js/**").permitAll()
|
||||||
|
// for swagger ui
|
||||||
|
.antMatchers("/v3/api-docs/**", "/swagger-ui/**", "/swagger-ui.html").permitAll()
|
||||||
.antMatchers("/api/**", "/apis/**").access(requestInfoAuthorizationManager())
|
.antMatchers("/api/**", "/apis/**").access(requestInfoAuthorizationManager())
|
||||||
.anyRequest().access(requestInfoAuthorizationManager())
|
.anyRequest().access(requestInfoAuthorizationManager())
|
||||||
)
|
)
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
server:
|
||||||
|
port: 8090
|
||||||
|
spring:
|
||||||
|
jackson:
|
||||||
|
date-format: yyyy-MM-dd HH:mm:ss
|
||||||
|
output:
|
||||||
|
ansi:
|
||||||
|
enabled: always
|
||||||
|
datasource:
|
||||||
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
|
|
||||||
|
# H2 database configuration.
|
||||||
|
driver-class-name: org.h2.Driver
|
||||||
|
url: jdbc:h2:file:~/halo-next/db/halo;AUTO_SERVER=TRUE
|
||||||
|
username: admin
|
||||||
|
password: 123456
|
||||||
|
|
||||||
|
jpa:
|
||||||
|
hibernate:
|
||||||
|
ddl-auto: update
|
||||||
|
open-in-view: false
|
||||||
|
show-sql: true
|
||||||
|
halo:
|
||||||
|
security:
|
||||||
|
oauth2:
|
||||||
|
jwt:
|
||||||
|
public-key-location: classpath:app.pub
|
||||||
|
private-key-location: classpath:app.key
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
run.halo.app: DEBUG
|
||||||
|
|
||||||
|
springdoc:
|
||||||
|
api-docs:
|
||||||
|
enabled: true
|
|
@ -6,10 +6,6 @@ spring:
|
||||||
output:
|
output:
|
||||||
ansi:
|
ansi:
|
||||||
enabled: always
|
enabled: always
|
||||||
devtools:
|
|
||||||
restart:
|
|
||||||
enabled: true
|
|
||||||
log-condition-evaluation-delta: false
|
|
||||||
datasource:
|
datasource:
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
|
|
||||||
|
@ -34,20 +30,14 @@ spring:
|
||||||
hibernate:
|
hibernate:
|
||||||
ddl-auto: update
|
ddl-auto: update
|
||||||
open-in-view: false
|
open-in-view: false
|
||||||
flyway:
|
|
||||||
enabled: true
|
|
||||||
locations:
|
|
||||||
- classpath:db/migration/common
|
|
||||||
- classpath:db/migration/{vendor}
|
|
||||||
halo:
|
halo:
|
||||||
security:
|
security:
|
||||||
oauth2:
|
oauth2:
|
||||||
jwt:
|
jwt:
|
||||||
public-key-location: classpath:app.pub
|
public-key-location: classpath:app.pub
|
||||||
private-key-location: classpath:app.key
|
private-key-location: classpath:app.key
|
||||||
logging:
|
|
||||||
level:
|
springdoc:
|
||||||
run.halo.app: DEBUG
|
api-docs:
|
||||||
org.hibernate: INFO
|
enabled: false
|
||||||
org.hibernate.type.descriptor.sql.BasicBinder: INFO
|
|
||||||
org.hibernate.type.descriptor.sql.BasicExtractor: INFO
|
|
||||||
|
|
Loading…
Reference in New Issue