mirror of
https://github.com/iflytek/skillhub.git
synced 2026-10-08 03:07:51 +00:00
feat: add Spring Boot application entry point and base configuration
- Create SkillhubApplication main class - Add application.yml with JPA, Flyway, graceful shutdown config - Add application-local.yml for local development profile - Add database and Redis dependencies to skillhub-app POM
This commit is contained in:
parent
43450f7dff
commit
5dff25ef1c
4 changed files with 91 additions and 0 deletions
|
|
@ -39,6 +39,32 @@
|
|||
<groupId>com.skillhub</groupId>
|
||||
<artifactId>skillhub-infra</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-database-postgresql</artifactId>
|
||||
<version>10.10.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.session</groupId>
|
||||
<artifactId>spring-session-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
package com.skillhub;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class SkillhubApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SkillhubApplication.class, args);
|
||||
}
|
||||
}
|
||||
20
server/skillhub-app/src/main/resources/application-local.yml
Normal file
20
server/skillhub-app/src/main/resources/application-local.yml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
spring:
|
||||
jpa:
|
||||
hibernate:
|
||||
ddl-auto: validate
|
||||
show-sql: true
|
||||
flyway:
|
||||
enabled: true
|
||||
datasource:
|
||||
url: jdbc:postgresql://localhost:5432/skillhub
|
||||
username: skillhub
|
||||
password: skillhub_dev
|
||||
data:
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.skillhub: DEBUG
|
||||
org.springframework.security: DEBUG
|
||||
34
server/skillhub-app/src/main/resources/application.yml
Normal file
34
server/skillhub-app/src/main/resources/application.yml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
server:
|
||||
port: 8080
|
||||
shutdown: graceful
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: skillhub
|
||||
lifecycle:
|
||||
timeout-per-shutdown-phase: 30s
|
||||
jpa:
|
||||
hibernate:
|
||||
ddl-auto: validate
|
||||
open-in-view: false
|
||||
properties:
|
||||
hibernate:
|
||||
dialect: org.hibernate.dialect.PostgreSQLDialect
|
||||
flyway:
|
||||
enabled: true
|
||||
locations: classpath:db/migration
|
||||
datasource:
|
||||
url: jdbc:postgresql://localhost:5432/skillhub
|
||||
username: skillhub
|
||||
password: skillhub_dev
|
||||
hikari:
|
||||
maximum-pool-size: 10
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info
|
||||
endpoint:
|
||||
health:
|
||||
show-details: when-authorized
|
||||
Loading…
Add table
Reference in a new issue