Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
scottsut committed Dec 6, 2021
2 parents 996f866 + c6ca9f8 commit 762600e
Show file tree
Hide file tree
Showing 618 changed files with 14,301 additions and 12,233 deletions.
29 changes: 29 additions & 0 deletions bin/datart-demo.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@echo off

REM Datart
REM <p>
REM Copyright 2021
REM <p>
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM <p>
REM http://www.apache.org/licenses/LICENSE-2.0
REM <p>
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.


if "%1"=="start" goto START


:START

cd /d %~dp0

cd ..

java -server -Xms2G -Xmx2G -Dspring.profiles.active=demo -Dfile.encoding=UTF-8 -cp ".\lib\*" datart.DatartServerApplication
29 changes: 29 additions & 0 deletions bin/datart-demo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# Datart
# <p>
# Copyright 2021
# <p>
# 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
# <p>
# http://www.apache.org/licenses/LICENSE-2.0
# <p>
# 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.

BASE_DIR=$(cd "$(dirname "$0")/.."; pwd -P)

echo "working dir ${BASE_DIR}"

cd "${BASE_DIR}"

CLASS_PATH="${BASE_DIR}/lib/*"

START_CLASS="datart.DatartServerApplication"

java -server -Xms2G -Xmx2G -Dspring.profiles.active=demo -Dfile.encoding=UTF-8 -cp "${CLASS_PATH}" datart.DatartServerApplication
2 changes: 1 addition & 1 deletion bin/datart-server.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ cd /d %~dp0

cd ..

java -server -Xms2G -Xmx2G -Dfile.encoding=UTF-8 -cp ".\lib\*" datart.DatartServerApplication
java -server -Xms2G -Xmx2G -Dspring.profiles.active=config -Dfile.encoding=UTF-8 -cp ".\lib\*" datart.DatartServerApplication
2 changes: 1 addition & 1 deletion bin/datart-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ CLASS_PATH="${BASE_DIR}/lib/*"

START_CLASS="datart.DatartServerApplication"

java -server -Xms2G -Xmx2G -Dfile.encoding=UTF-8 -cp "${CLASS_PATH}" datart.DatartServerApplication
java -server -Xms2G -Xmx2G -Dspring.profiles.active=config -Dfile.encoding=UTF-8 -cp "${CLASS_PATH}" datart.DatartServerApplication
29 changes: 7 additions & 22 deletions bin/datart.sql
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
/*
Navicat Premium Data Transfer
Source Server Type : MySQL
Source Server Version : 50732
Source Schema : datart
Target Server Type : MySQL
Target Server Version : 50732
File Encoding : 65001
Date: 15/10/2021 10:29:53
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

Expand Down Expand Up @@ -265,13 +251,13 @@ CREATE TABLE `download` (
-- ----------------------------
DROP TABLE IF EXISTS `folder`;
CREATE TABLE `folder` (
`id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`org_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`rel_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`rel_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,
`parent_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,
`index` double(255, 0) NULL DEFAULT NULL,
`index` double(16, 8) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `name_unique`(`name`, `org_id`, `parent_id`) USING BTREE,
INDEX `org_id`(`org_id`) USING BTREE,
Expand All @@ -284,7 +270,7 @@ CREATE TABLE `folder` (
-- ----------------------------
DROP TABLE IF EXISTS `link`;
CREATE TABLE `link` (
`id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`rel_type` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`rel_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`url` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
Expand All @@ -299,7 +285,7 @@ CREATE TABLE `link` (
-- ----------------------------
DROP TABLE IF EXISTS `org_settings`;
CREATE TABLE `org_settings` (
`id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`org_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,
`type` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,
`config` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL,
Expand Down Expand Up @@ -533,7 +519,6 @@ CREATE TABLE `source` (
`update_time` timestamp(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
`status` tinyint(6) NOT NULL DEFAULT 1,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `prj_name`(`name`) USING BTREE,
UNIQUE INDEX `org_name`(`name`, `org_id`) USING BTREE,
INDEX `org_id`(`org_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
Expand Down Expand Up @@ -561,7 +546,7 @@ CREATE TABLE `storyboard` (
-- ----------------------------
DROP TABLE IF EXISTS `storypage`;
CREATE TABLE `storypage` (
`id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`storyboard_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`rel_type` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`rel_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
Expand Down Expand Up @@ -599,7 +584,7 @@ CREATE TABLE `user` (
-- ----------------------------
DROP TABLE IF EXISTS `user_settings`;
CREATE TABLE `user_settings` (
`id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`user_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`rel_type` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`rel_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,
Expand Down Expand Up @@ -653,7 +638,7 @@ CREATE TABLE `view` (
`update_time` timestamp(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
`parent_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`is_folder` tinyint(1) NULL DEFAULT NULL,
`index` double NULL DEFAULT NULL,
`index` double(16, 8) NULL DEFAULT NULL,
`status` tinyint(6) NOT NULL DEFAULT 1,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `unique_name`(`name`, `org_id`, `parent_id`) USING BTREE,
Expand Down
Binary file added bin/h2/datart.demo.mv.db
Binary file not shown.
Empty file added bin/h2/datart.demo.trace.db
Empty file.
5 changes: 5 additions & 0 deletions bin/migrations/migration.1.0.0-alpha.3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE `view`
MODIFY COLUMN `index` double(16, 8) NULL DEFAULT NULL AFTER `is_folder`;

ALTER TABLE `folder`
MODIFY COLUMN `index` double(16, 8) NULL DEFAULT NULL AFTER `parent_id`;
44 changes: 25 additions & 19 deletions config/application-config.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ spring:

# mail config

# mail:
# host: { 邮箱服务地址 }
# port: { 端口号 }
# username: { 邮箱地址 }
# fromAddress:
# password: { 邮箱服务密码 }
# senderName: { 发送者昵称 }
#
# properties:
# smtp:
# starttls:
# enable: true
# required: true
# auth: true
# mail:
# smtp:
# ssl:
# enable: true
# mail:
# host: { 邮箱服务地址 }
# port: { 端口号 }
# username: { 邮箱地址 }
# fromAddress:
# password: { 邮箱服务密码 }
# senderName: { 发送者昵称 }
#
# properties:
# smtp:
# starttls:
# enable: true
# required: true
# auth: true
# mail:
# smtp:
# ssl:
# enable: true


# redis config
Expand All @@ -38,6 +38,12 @@ spring:
server:
port: { PORT }
address: { IP }

# 开启 gzip 压缩,加快请求和响应速度
compression:
enabled: true
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*


datart:
server:
Expand All @@ -58,4 +64,4 @@ datart:
screenshot:
timeout-seconds: 60
webdriver-type: CHROME
webdriver-path: { Web Driver Path }
webdriver-path: { Web Driver Path }
38 changes: 38 additions & 0 deletions config/application-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
spring:
datasource:
driver-class-name: org.h2.Driver
type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:h2:file:./bin/h2/datart.demo;MODE=MYSQL;DATABASE_TO_UPPER=false
username:
password:

server:
port: 8080
address: 0.0.0.0

# 开启 gzip 压缩,加快请求和响应速度
compression:
enabled: true
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*


datart:
server:
address: http://127.0.0.1:8080

user:
active:
send-mail: false # 注册用户时是否需要邮件验证激活

security:
token:
secret: "d@a$t%a^r&a*t" #加密密钥
timeout-min: 30 # 登录会话有效时长,单位:分钟。

env:
file-path: ${user.dir}/files # 服务端文件保存位置

screenshot:
timeout-seconds: 60
webdriver-type: CHROME
webdriver-path:
3 changes: 2 additions & 1 deletion config/jdbc-driver-ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ IMPALA:
literal-quote: "'"
identifier-quote: "`"
adapter-class: "datart.data.provider.jdbc.adapters.ImpalaDataProviderAdapter"
url-prefix: "jdbc:impala://"
url-prefix: "jdbc:impala://"
sql-dialect: "datart.data.provider.calcite.dialect.ImpalaSqlDialectSupport"
8 changes: 7 additions & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>datart-parent</artifactId>
<groupId>datart</groupId>
<version>1.0.0-alpha.2</version>
<version>1.0.0-alpha.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -146,6 +146,12 @@
<artifactId>jakarta.validation-api</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.8</version>
</dependency>

</dependencies>

<build>
Expand Down
4 changes: 4 additions & 0 deletions core/src/main/java/datart/core/base/PageInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@
*/
package datart.core.base;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PageInfo implements Serializable {

private long pageSize;
Expand Down
16 changes: 0 additions & 16 deletions core/src/main/java/datart/core/base/consts/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ public class Const {

public static final byte DATA_STATUS_ARCHIVED = 0;

public static final byte DATA_STATUS_CREATING = 1;

public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";

/**
Expand All @@ -45,14 +43,6 @@ public class Const {
/**
* 脚本变量
*/
//系统变量模板,匹配系统变量的表达式。
//public static final String REG_SYS_VAR_TEMPLATE = "[\\u4E00-\\u9FA5A-Za-z0-9._-`\"']+\\s*[!=]{1,2}\\s*[`\"'\\[]*[%s]{1}[`\"']]*";
//匹配所有的变量
// public static final String REG_VARIABLE_TEMPLATE = "%s[\\u4E00-\\u9FA5A-Za-z0-9._-]+%s";
//权限变量表达式模板,匹配权限变量的整个条件表达式
// public static final String REG_AUTH_VAR_TEMPLATE = "[\\u4E00-\\u9FA5A-Za-z0-9._-`\"']+\\s*(IN|NOT\\s+IN|IS\\s+NULL|LIKE|EXISTS|>|<|=|!)+\\s*[`\"']*(%s){1}[`\"']*";
//查询变量正则模板,匹配查询变量及其左右的引用符、括号等
// public static final String REG_QUERY_VAR_TEMPLATE = "[`\"'\\(]*(%s){1}[`\"'\\)]*";
//默认的变量引用符号
public static final String DEFAULT_VARIABLE_QUOTE = "$";

Expand All @@ -69,12 +59,6 @@ public class Const {

public static final String TOKEN_HEADER_PREFIX = "Bearer ";

/**
* 组织头像保存路径
*/

public static final String PROTOCOL_HTTP_PRE = "HTTP://";

/**
* 权限等级定义
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,4 @@ public enum VariableTypeEnum {
*/
PERMISSION,

/**
* 系统变量
*/
// SYS,

}
Loading

0 comments on commit 762600e

Please sign in to comment.