45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
|
- rest:
|
||
|
id: rest-8fb6
|
||
|
path: /api/db
|
||
|
consumes: application/json
|
||
|
produces: application/json
|
||
|
post:
|
||
|
- id: post-77e8
|
||
|
description: 初始化数据库
|
||
|
path: /init
|
||
|
to: direct:initDatabase
|
||
|
- route:
|
||
|
id: route-85b8
|
||
|
nodePrefixId: route-b60
|
||
|
from:
|
||
|
id: from-5e76
|
||
|
uri: direct
|
||
|
parameters:
|
||
|
name: initDatabase
|
||
|
steps:
|
||
|
- log:
|
||
|
id: log-5310
|
||
|
message: 初始化数据库...
|
||
|
loggingLevel: INFO
|
||
|
logName: com.example.route.init
|
||
|
- process:
|
||
|
id: process-0abf
|
||
|
ref: databaseInitializer
|
||
|
- log:
|
||
|
id: log-5124
|
||
|
message: 数据库初始化完成
|
||
|
loggingLevel: INFO
|
||
|
logName: com.example.route.init
|
||
|
- beans:
|
||
|
- name: postgresDatabase
|
||
|
type: "#class:org.apache.commons.dbcp2.BasicDataSource"
|
||
|
properties:
|
||
|
username: postgres
|
||
|
password: 1qaz123$
|
||
|
url: jdbc:postgresql://192.168.56.12:5432/user_db2
|
||
|
driverClassName: org.postgresql.Driver
|
||
|
- name: databaseInitializer
|
||
|
type: com.example.util.DatabaseInitializer
|
||
|
properties:
|
||
|
dataSource: "#postgresDatabase"
|