mirror of
https://gitee.com/devlive-community/datacap.git
synced 2024-12-04 21:18:22 +08:00
Feature all one (#69)
This commit is contained in:
commit
9707b8204a
6
.github/workflows/publish-docs.yml
vendored
6
.github/workflows/publish-docs.yml
vendored
@ -1,10 +1,6 @@
|
|||||||
name: Publish docs via GitHub Pages
|
name: Publish docs via GitHub Pages
|
||||||
|
|
||||||
on:
|
on: push
|
||||||
pull_request:
|
|
||||||
branch:
|
|
||||||
- 'master'
|
|
||||||
types: [ closed ]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
2
.github/workflows/publish-selfhost.yml
vendored
2
.github/workflows/publish-selfhost.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
|||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: '8'
|
java-version: '8'
|
||||||
distribution: 'temurin'
|
distribution: 'adopt'
|
||||||
- name: Chmod
|
- name: Chmod
|
||||||
run: chmod 755 ./mvnw
|
run: chmod 755 ./mvnw
|
||||||
- name: Package
|
- name: Package
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -32,7 +32,7 @@ target/
|
|||||||
|
|
||||||
# node #
|
# node #
|
||||||
node/
|
node/
|
||||||
package-lock.json
|
#package-lock.json
|
||||||
node_modules
|
node_modules
|
||||||
yarn.lock
|
yarn.lock
|
||||||
release/
|
release/
|
||||||
|
@ -19,7 +19,7 @@ public class DruidConnection
|
|||||||
@Override
|
@Override
|
||||||
protected String formatJdbcUrl()
|
protected String formatJdbcUrl()
|
||||||
{
|
{
|
||||||
JdbcConfigure jdbcConfigure = this.getConfigure();
|
JdbcConfigure jdbcConfigure = (JdbcConfigure) this.getConfigure();
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
buffer.append("jdbc:");
|
buffer.append("jdbc:");
|
||||||
buffer.append(jdbcConfigure.getJdbcType());
|
buffer.append(jdbcConfigure.getJdbcType());
|
||||||
|
@ -39,7 +39,6 @@ job_runner_start_server() {
|
|||||||
printf "Server starting | %s\n" "$APPLICATION_NAME"
|
printf "Server starting | %s\n" "$APPLICATION_NAME"
|
||||||
cd "$HOME"
|
cd "$HOME"
|
||||||
nohup "$JAVA_HOME"/bin/java -classpath 'lib/*' "$APPLICATION_NAME" \
|
nohup "$JAVA_HOME"/bin/java -classpath 'lib/*' "$APPLICATION_NAME" \
|
||||||
--logging.config="$HOME/configure/logback.xml" \
|
|
||||||
--spring.config.location="$HOME/configure/" > /dev/null 2>&1 &
|
--spring.config.location="$HOME/configure/" > /dev/null 2>&1 &
|
||||||
sleep 5
|
sleep 5
|
||||||
job_before_apply_server
|
job_before_apply_server
|
||||||
|
@ -43,8 +43,8 @@ public class JdbcAdapter
|
|||||||
Time processorTime = new Time();
|
Time processorTime = new Time();
|
||||||
processorTime.setStart(new Date().getTime());
|
processorTime.setStart(new Date().getTime());
|
||||||
Response response = this.jdbcConnection.getResponse();
|
Response response = this.jdbcConnection.getResponse();
|
||||||
Connection connection = this.jdbcConnection.getConnection();
|
Connection connection = (Connection) this.jdbcConnection.getConnection();
|
||||||
JdbcConfigure configure = this.jdbcConnection.getConfigure();
|
JdbcConfigure configure = (JdbcConfigure) this.jdbcConnection.getConfigure();
|
||||||
if (response.getIsConnected()) {
|
if (response.getIsConnected()) {
|
||||||
try (Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery(content)) {
|
try (Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery(content)) {
|
||||||
List<String> headers = new ArrayList<>();
|
List<String> headers = new ArrayList<>();
|
||||||
|
@ -0,0 +1,46 @@
|
|||||||
|
package io.edurt.datacap.spi.connection;
|
||||||
|
|
||||||
|
import io.edurt.datacap.spi.model.Configure;
|
||||||
|
import io.edurt.datacap.spi.model.Response;
|
||||||
|
import io.edurt.datacap.spi.model.Time;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public abstract class Connection
|
||||||
|
{
|
||||||
|
private final Configure configure;
|
||||||
|
private final Response response;
|
||||||
|
private Object connection;
|
||||||
|
|
||||||
|
public Connection(Configure configure, Response response)
|
||||||
|
{
|
||||||
|
this.configure = configure;
|
||||||
|
this.response = response;
|
||||||
|
Time connectionTime = new Time();
|
||||||
|
connectionTime.setStart(new Date().getTime());
|
||||||
|
this.connection = this.openConnection();
|
||||||
|
connectionTime.setEnd(new Date().getTime());
|
||||||
|
this.response.setConnection(connectionTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract String formatJdbcUrl();
|
||||||
|
|
||||||
|
protected abstract java.sql.Connection openConnection();
|
||||||
|
|
||||||
|
public Object getConnection()
|
||||||
|
{
|
||||||
|
return this.connection;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Response getResponse()
|
||||||
|
{
|
||||||
|
return this.response;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Configure getConfigure()
|
||||||
|
{
|
||||||
|
return this.configure;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void destroy();
|
||||||
|
}
|
@ -1,34 +1,27 @@
|
|||||||
package io.edurt.datacap.spi.connection;
|
package io.edurt.datacap.spi.connection;
|
||||||
|
|
||||||
import io.edurt.datacap.spi.model.Response;
|
import io.edurt.datacap.spi.model.Response;
|
||||||
import io.edurt.datacap.spi.model.Time;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class JdbcConnection
|
public class JdbcConnection
|
||||||
|
extends io.edurt.datacap.spi.connection.Connection
|
||||||
{
|
{
|
||||||
private final JdbcConfigure jdbcConfigure;
|
private JdbcConfigure jdbcConfigure;
|
||||||
private final Response response;
|
private Response response;
|
||||||
private Connection connection;
|
private Connection connection;
|
||||||
|
|
||||||
public JdbcConnection(JdbcConfigure jdbcConfigure, Response response)
|
public JdbcConnection(JdbcConfigure jdbcConfigure, Response response)
|
||||||
{
|
{
|
||||||
this.jdbcConfigure = jdbcConfigure;
|
super(jdbcConfigure, response);
|
||||||
this.response = response;
|
|
||||||
Time connectionTime = new Time();
|
|
||||||
connectionTime.setStart(new Date().getTime());
|
|
||||||
this.openConnection();
|
|
||||||
connectionTime.setEnd(new Date().getTime());
|
|
||||||
this.response.setConnection(connectionTime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String formatJdbcUrl()
|
protected String formatJdbcUrl()
|
||||||
@ -56,9 +49,11 @@ public class JdbcConnection
|
|||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Connection openConnection()
|
protected Connection openConnection()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
this.jdbcConfigure = (JdbcConfigure) getConfigure();
|
||||||
|
this.response = getResponse();
|
||||||
Class.forName(this.jdbcConfigure.getJdbcDriver());
|
Class.forName(this.jdbcConfigure.getJdbcDriver());
|
||||||
String url = formatJdbcUrl();
|
String url = formatJdbcUrl();
|
||||||
log.info("Connection driver {}", this.jdbcConfigure.getJdbcDriver());
|
log.info("Connection driver {}", this.jdbcConfigure.getJdbcDriver());
|
||||||
@ -81,21 +76,6 @@ public class JdbcConnection
|
|||||||
return this.connection;
|
return this.connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Connection getConnection()
|
|
||||||
{
|
|
||||||
return this.connection;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Response getResponse()
|
|
||||||
{
|
|
||||||
return this.response;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JdbcConfigure getConfigure()
|
|
||||||
{
|
|
||||||
return this.jdbcConfigure;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void destroy()
|
public void destroy()
|
||||||
{
|
{
|
||||||
if (ObjectUtils.isNotEmpty(this.connection)) {
|
if (ObjectUtils.isNotEmpty(this.connection)) {
|
||||||
|
21291
web/console-fe/package-lock.json
generated
Normal file
21291
web/console-fe/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user