Feature all one (#69)

This commit is contained in:
qianmoQ 2022-10-10 22:05:06 +08:00 committed by GitHub
commit 9707b8204a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 21350 additions and 38 deletions

View File

@ -1,10 +1,6 @@
name: Publish docs via GitHub Pages
on:
pull_request:
branch:
- 'master'
types: [ closed ]
on: push
jobs:
deploy:

View File

@ -12,7 +12,7 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
distribution: 'adopt'
- name: Chmod
run: chmod 755 ./mvnw
- name: Package

2
.gitignore vendored
View File

@ -32,7 +32,7 @@ target/
# node #
node/
package-lock.json
#package-lock.json
node_modules
yarn.lock
release/

View File

@ -19,7 +19,7 @@ public class DruidConnection
@Override
protected String formatJdbcUrl()
{
JdbcConfigure jdbcConfigure = this.getConfigure();
JdbcConfigure jdbcConfigure = (JdbcConfigure) this.getConfigure();
StringBuffer buffer = new StringBuffer();
buffer.append("jdbc:");
buffer.append(jdbcConfigure.getJdbcType());

View File

@ -39,7 +39,6 @@ job_runner_start_server() {
printf "Server starting | %s\n" "$APPLICATION_NAME"
cd "$HOME"
nohup "$JAVA_HOME"/bin/java -classpath 'lib/*' "$APPLICATION_NAME" \
--logging.config="$HOME/configure/logback.xml" \
--spring.config.location="$HOME/configure/" > /dev/null 2>&1 &
sleep 5
job_before_apply_server

View File

@ -43,8 +43,8 @@ public class JdbcAdapter
Time processorTime = new Time();
processorTime.setStart(new Date().getTime());
Response response = this.jdbcConnection.getResponse();
Connection connection = this.jdbcConnection.getConnection();
JdbcConfigure configure = this.jdbcConnection.getConfigure();
Connection connection = (Connection) this.jdbcConnection.getConnection();
JdbcConfigure configure = (JdbcConfigure) this.jdbcConnection.getConfigure();
if (response.getIsConnected()) {
try (Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery(content)) {
List<String> headers = new ArrayList<>();

View File

@ -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();
}

View File

@ -1,34 +1,27 @@
package io.edurt.datacap.spi.connection;
import io.edurt.datacap.spi.model.Response;
import io.edurt.datacap.spi.model.Time;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
public class JdbcConnection
extends io.edurt.datacap.spi.connection.Connection
{
private final JdbcConfigure jdbcConfigure;
private final Response response;
private JdbcConfigure jdbcConfigure;
private Response response;
private Connection connection;
public JdbcConnection(JdbcConfigure jdbcConfigure, Response response)
{
this.jdbcConfigure = jdbcConfigure;
this.response = response;
Time connectionTime = new Time();
connectionTime.setStart(new Date().getTime());
this.openConnection();
connectionTime.setEnd(new Date().getTime());
this.response.setConnection(connectionTime);
super(jdbcConfigure, response);
}
protected String formatJdbcUrl()
@ -56,9 +49,11 @@ public class JdbcConnection
return buffer.toString();
}
private Connection openConnection()
protected Connection openConnection()
{
try {
this.jdbcConfigure = (JdbcConfigure) getConfigure();
this.response = getResponse();
Class.forName(this.jdbcConfigure.getJdbcDriver());
String url = formatJdbcUrl();
log.info("Connection driver {}", this.jdbcConfigure.getJdbcDriver());
@ -81,21 +76,6 @@ public class JdbcConnection
return this.connection;
}
public Connection getConnection()
{
return this.connection;
}
public Response getResponse()
{
return this.response;
}
public JdbcConfigure getConfigure()
{
return this.jdbcConfigure;
}
public void destroy()
{
if (ObjectUtils.isNotEmpty(this.connection)) {

21291
web/console-fe/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff