Skip to content

Commit

Permalink
添加View对team@var的支持
Browse files Browse the repository at this point in the history
1、添加View对team@var的支持
2、修改team树结构
3、导入csv只支持mysql
  • Loading branch information
RichardShan committed Aug 9, 2018
1 parent ff628b2 commit 644a447
Show file tree
Hide file tree
Showing 34 changed files with 486 additions and 214 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ spark-warehouse
*.bak
*.log
*.conf
config/application.yml
swagger-ui/
lib/
tempFiles/
userfiles/
.vscode
*yarn.lock
4 changes: 2 additions & 2 deletions bin/start-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

#start server

Server=`ps -ef | grep java | grep davinci-server-0.3-0.0.1-SNAPSHOT | grep -v grep | awk '{print $2}'`
Server=`ps -ef | grep java | grep davinci-server_3.01-0.3.0-SNAPSHOT | grep -v grep | awk '{print $2}'`
if [[ $Server -gt 0 ]]; then
echo "[Davinci Server] is already started"
exit
fi

script_dir=$(cd `dirname $0`; pwd)
cd $script_dir/../
nohup java -cp lib/*:davinci-server-0.3-0.0.1-SNAPSHOT.jar edp.DavinciServerApplication >/dev/null 2>&1 &
nohup java -cp lib/*:davinci-server_3.01-0.3.0-SNAPSHOT.jar edp.DavinciServerApplication >/dev/null 2>&1 &
2 changes: 1 addition & 1 deletion bin/stop-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# >>


Server=`ps -ef | grep java | grep davinci-server-0.3-0.0.1-SNAPSHOT | grep -v grep | awk '{print $2}'`
Server=`ps -ef | grep java | grep davinci-server_3.01-0.3.0-SNAPSHOT | grep -v grep | awk '{print $2}'`
if [[ $Server -gt 0 ]]; then
kill -9 $Server
else
Expand Down
97 changes: 0 additions & 97 deletions config/application.yml

This file was deleted.

7 changes: 3 additions & 4 deletions config/application.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jwtToken:
source:
initial-size: 2
min-idle: 1
max-wait: 60000
max-wait: 6000
max-active: 10

spring:
Expand All @@ -48,14 +48,13 @@ spring:
max-active: 10

redis:

isEnable: false
# standalone config

## standalone config
host: 127.0.0.1
port: 6379

# cluster config
## cluster config

# cluster:
# nodes:
Expand Down
2 changes: 1 addition & 1 deletion config/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<appender name="INFO_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>DENY</onMatch>
<onMatch>ACCEPT</onMatch>
<onMismatch>ACCEPT</onMismatch>
</filter>

Expand Down
13 changes: 12 additions & 1 deletion server/src/main/java/edp/core/utils/SqlUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,18 @@ public List<TableInfo> getTableList() throws SourceException {
}
}
resultSet.close();
String sql = "select * from `" + tableName + "`";
DataTypeEnum dataTypeEnum = DataTypeEnum.urlOf(this.jdbcUrl);
String sql = "select * from " + tableName + "";
switch (dataTypeEnum) {
case MYSQL:
sql = "select * from `" + tableName + "`";
break;
case ORACLE:
sql = "select * from '" + tableName + "'";
break;
default:
break;
}
List<QueryColumn> columns = getColumns(sql);
TableInfo tableInfo = new TableInfo(tableName, primaryKeys, columns);
tableInfoList.add(tableInfo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

@ApiIgnore
@Controller
@Slf4j
public class HomeController {

@RequestMapping("swagger")
Expand Down
53 changes: 53 additions & 0 deletions server/src/main/java/edp/davinci/core/enums/SqlOperatorEnum.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* <<
* Davinci
* ==
* Copyright (C) 2016 - 2018 EDP
* ==
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* >>
*/

package edp.davinci.core.enums;

public enum SqlOperatorEnum {
IN("IN"),
NoTIN("NOT IN"),
EQUALSTO("="),
BETWEEN("BETWEEN"),
GREATERTHAN(">"),
GREATERTHANEQUALS(">="),
ISNULL("IS NULL"),
LIKE("LIKE"),
MINORTHAN("<"),
MINORTHANEQUALS("<="),
NOTEQUALSTO("!="),
EXISTS("EXISTS");

private String value;

SqlOperatorEnum(String value) {
this.value = value;
}

public String getValue() {
return value;
}

public static SqlOperatorEnum getSqlOperator(String src) {
for (SqlOperatorEnum operatorEnum : SqlOperatorEnum.values()) {
if (src.toUpperCase().indexOf(operatorEnum.value) > -1) {
return operatorEnum;
}
}
return null;
}
}
9 changes: 6 additions & 3 deletions server/src/main/java/edp/davinci/core/model/SqlEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ public class SqlEntity {
//执行sql
private List<String> executeSql;

private Map<String, String> params;
private Map<String, String> quaryParams;

private Map<String, List<String>> teamParams;

public SqlEntity() {
}

public SqlEntity(List<String> querySql, List<String> executeSql, Map<String, String> params) {
public SqlEntity(List<String> querySql, List<String> executeSql, Map<String, String> quaryParams, Map<String, List<String>> teamParams) {
this.querySql = querySql;
this.executeSql = executeSql;
this.params = params;
this.quaryParams = quaryParams;
this.teamParams = teamParams;
}
}
Loading

0 comments on commit 644a447

Please sign in to comment.