Skip to content

Commit 79f83eb

Browse files
authored
Merge pull request running-elephant#548 from scottsut/master
feat: 1.0.0-beta.0 release
2 parents f35069c + 6f9821a commit 79f83eb

File tree

583 files changed

+19923
-6178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

583 files changed

+19923
-6178
lines changed

Deployment.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ title: 部署
1212

1313
- JDK 1.8+
1414
- MySql5.7+
15-
- datart安装包(datart-server-1.0.0-alpha.3-install.zip)
15+
- datart安装包(datart-server-1.0.0-beta.x-install.zip)
1616
- Mail Server (可选)
1717
- [ChromeWebDriver](https://chromedriver.chromium.org/) (可选)
1818
- Redis (可选)
1919

2020
方式1 :解压安装包 (官方提供的包)
2121

2222
```bash
23-
unzip datart-server-1.0.0-alpha.3-install.zip
23+
unzip datart-server-1.0.0-beta.x-install.zip
2424
```
2525

2626
方式2 :自行编译
@@ -32,11 +32,11 @@ cd datart
3232

3333
mvn clean package -Dmaven.test.skip=true
3434

35-
cp ./datart-server-1.0.0-alpha.3-install.zip ${deployment_basedir}
35+
cp ./datart-server-1.0.0-beta.x-install.zip ${deployment_basedir}
3636

3737
cd ${deployment_basedir}
3838

39-
unzip datart-server-1.0.0-alpha.3-install.zip
39+
unzip datart-server-1.0.0-beta.x-install.zip
4040

4141
```
4242

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ datart 可作为独立平台使用,但不仅限于此,为了更好支持快
5252
![](https://running-elephant.github.io/datart-docs/images/about/wechat-group.jpeg)
5353

5454
#### 插件示例仓库
55-
[示例仓库 v1.0.0](https://github.com/Cuiyansong/datart-extension-charts)
55+
[示例仓库 v1.0.0](https://github.com/running-elephan/datart-extension-charts)
5656

5757
### 参与贡献 Contributing
5858
非常欢迎和感谢参与贡献,如何参与可参见 [Contributing]()

README_zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ datart 是新一代数据可视化开放平台,支持各类企业数据可视
4242
参见 [User Guide](http://running-elephant.gitee.io/datart-docs/docs/source.html)
4343

4444
### 最新版本 Latest Release
45-
参见 [Latest Release](https://gitee.com/running-elephant/datart/releases/1.0.0-alpha.3)
45+
参见 [Latest Release](https://gitee.com/running-elephant/datart/releases)
4646

4747
## Community
4848
### 社区支持 Support

bin/h2/datart.demo.mv.db

-36 KB
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE `datachart`
2+
MODIFY COLUMN `config` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `org_id`;

core/pom.xml

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>datart-parent</artifactId>
77
<groupId>datart</groupId>
8-
<version>1.0.0-alpha.3</version>
8+
<version>1.0.0-beta.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

@@ -157,39 +157,45 @@
157157
<build>
158158
<plugins>
159159
<!--MyBatis generator-->
160+
<!-- <plugin>-->
161+
<!-- <groupId>org.mybatis.generator</groupId>-->
162+
<!-- <artifactId>mybatis-generator-maven-plugin</artifactId>-->
163+
<!-- <version>1.4.0</version>-->
164+
<!-- <configuration>-->
165+
<!-- <configurationFile>src/main/resources/mybatis-generator/generatorConfig.xml</configurationFile>-->
166+
<!-- <verbose>true</verbose>-->
167+
<!-- <overwrite>true</overwrite>-->
168+
<!-- <includeAllDependencies>true</includeAllDependencies>-->
169+
<!-- </configuration>-->
170+
<!-- <executions>-->
171+
<!-- <execution>-->
172+
<!-- <id>Generate MyBatis Artifacts</id>-->
173+
<!-- <goals>-->
174+
<!-- <goal>generate</goal>-->
175+
<!-- </goals>-->
176+
<!-- <phase>install</phase>-->
177+
<!-- </execution>-->
178+
<!-- </executions>-->
179+
<!-- <dependencies>-->
180+
<!-- <dependency>-->
181+
<!-- <groupId>mysql</groupId>-->
182+
<!-- <artifactId>mysql-connector-java</artifactId>-->
183+
<!-- <version>5.1.49</version>-->
184+
<!-- </dependency>-->
185+
<!-- <dependency>-->
186+
<!-- <groupId>datart</groupId>-->
187+
<!-- <artifactId>datart-core</artifactId>-->
188+
<!-- <version>${project.version}</version>-->
189+
<!-- </dependency>-->
190+
<!-- </dependencies>-->
191+
<!-- </plugin>-->
160192
<plugin>
161-
<groupId>org.mybatis.generator</groupId>
162-
<artifactId>mybatis-generator-maven-plugin</artifactId>
163-
<version>1.4.0</version>
193+
<groupId>org.apache.maven.plugins</groupId>
194+
<artifactId>maven-compiler-plugin</artifactId>
164195
<configuration>
165-
<configurationFile>src/main/resources/mybatis-generator/generatorConfig.xml</configurationFile>
166-
<verbose>true</verbose>
167-
<overwrite>true</overwrite>
168-
<includeAllDependencies>true</includeAllDependencies>
196+
<parameters>true</parameters>
169197
</configuration>
170-
<executions>
171-
<execution>
172-
<id>Generate MyBatis Artifacts</id>
173-
<goals>
174-
<goal>generate</goal>
175-
</goals>
176-
<phase>install</phase>
177-
</execution>
178-
</executions>
179-
<dependencies>
180-
<dependency>
181-
<groupId>mysql</groupId>
182-
<artifactId>mysql-connector-java</artifactId>
183-
<version>5.1.49</version>
184-
</dependency>
185-
<dependency>
186-
<groupId>datart</groupId>
187-
<artifactId>datart-core</artifactId>
188-
<version>${project.version}</version>
189-
</dependency>
190-
</dependencies>
191198
</plugin>
192-
193199
</plugins>
194200

195201
</build>

core/src/main/java/datart/core/base/consts/Const.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class Const {
3333
* 正则表达式
3434
*/
3535

36-
public static final String REG_EMAIL = "^[a-z_0-9.-]{1,64}@([a-z0-9-]{1,200}.){1,5}[a-z]{1,6}$";
36+
public static final String REG_EMAIL = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$";
3737

3838
public static final String REG_USER_PASSWORD = ".{6,20}";
3939

@@ -45,7 +45,8 @@ public class Const {
4545
*/
4646
//默认的变量引用符号
4747
public static final String DEFAULT_VARIABLE_QUOTE = "$";
48-
48+
//变量匹配符
49+
public static final String VARIABLE_EXP = "\\$\\w+\\$";
4950
/**
5051
* 权限变量
5152
*/

core/src/main/java/datart/core/common/CSVParse.java

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
*/
1818
package datart.core.common;
1919

20-
import datart.core.base.consts.Const;
2120
import datart.core.base.consts.ValueType;
22-
import datart.core.base.exception.BaseException;
2321
import datart.core.base.exception.Exceptions;
2422
import lombok.Data;
2523
import org.apache.commons.csv.CSVFormat;
@@ -31,7 +29,6 @@
3129
import java.io.File;
3230
import java.io.IOException;
3331
import java.nio.charset.StandardCharsets;
34-
import java.text.ParseException;
3532
import java.text.SimpleDateFormat;
3633
import java.util.Collections;
3734
import java.util.LinkedList;
@@ -40,32 +37,22 @@
4037

4138
public class CSVParse {
4239

43-
public static final ParseConfig DEFAULT_CONFIG = new ParseConfig();
44-
45-
static {
46-
DEFAULT_CONFIG.setDateFormat(Const.DEFAULT_DATE_FORMAT);
47-
}
48-
4940
private String path;
5041

51-
private ParseConfig parseConfig;
52-
5342
private ValueType[] types;
5443

5544
private SimpleDateFormat simpleDateFormat;
5645

5746
public static CSVParse create(String path, ParseConfig parseConfig) {
5847
CSVParse csvParse = new CSVParse();
5948
csvParse.path = path;
60-
csvParse.parseConfig = parseConfig;
6149
csvParse.simpleDateFormat = new SimpleDateFormat(parseConfig.getDateFormat());
6250
return csvParse;
6351
}
6452

6553
public static CSVParse create(String path) {
6654
CSVParse csvParse = new CSVParse();
6755
csvParse.path = path;
68-
csvParse.parseConfig = DEFAULT_CONFIG;
6956
return csvParse;
7057
}
7158

@@ -111,32 +98,11 @@ private List<Object> extractValues(CSVRecord record) {
11198
}
11299
LinkedList<Object> values = new LinkedList<>();
113100
for (int i = 0; i < record.size(); i++) {
114-
Object val;
115-
try {
116-
val = parseValue(record.get(i), types[i]);
117-
} catch (Exception e) {
118-
val = record.get(i);
119-
}
120-
values.add(val);
101+
values.add(record.get(i));
121102
}
122103
return values;
123104
}
124105

125-
private Object parseValue(String val, ValueType valueType) throws ParseException {
126-
switch (valueType) {
127-
case DATE:
128-
return simpleDateFormat.parse(val);
129-
case NUMERIC:
130-
if (NumberUtils.isDigits(val)) {
131-
return Long.parseLong(val);
132-
} else {
133-
return Double.parseDouble(val);
134-
}
135-
default:
136-
return val;
137-
}
138-
}
139-
140106
@Data
141107
public static class ParseConfig {
142108
private String dateFormat;

core/src/main/java/datart/core/common/CacheFactory.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
package datart.core.common;
22

33
import lombok.extern.slf4j.Slf4j;
4+
import org.apache.commons.lang3.StringUtils;
45

56
@Slf4j
67
public class CacheFactory {
78

89
private static final String CACHE_IMPL_CLASS_NAME = "cacheImpl";
910

11+
private static final String DEFAULT_CACHE = "datart.server.service.impl.RedisCacheImpl";
12+
1013
private static Cache cache;
1114

1215
public static Cache getCache() {
@@ -15,6 +18,9 @@ public static Cache getCache() {
1518
}
1619
try {
1720
String className = Application.getProperty(CACHE_IMPL_CLASS_NAME);
21+
if (StringUtils.isBlank(className)) {
22+
className = DEFAULT_CACHE;
23+
}
1824
cache = (Cache) Application.getBean(Class.forName(className));
1925
return cache;
2026
} catch (Exception e) {
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Datart
3+
* <p>
4+
* Copyright 2021
5+
* <p>
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
* <p>
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
* <p>
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
package datart.core.common;
20+
21+
public class DateUtils {
22+
23+
private static final String[] FMT = {"y", "M", "d", "H", "m", "s", "S"};
24+
25+
public static String inferDateFormat(String src) {
26+
int fmtIdx = 0;
27+
boolean findMatch = false;
28+
StringBuilder stringBuilder = new StringBuilder();
29+
for (int i = 0; i < src.length(); i++) {
30+
char chr = src.charAt(i);
31+
if (Character.isDigit(chr)) {
32+
findMatch = true;
33+
stringBuilder.append(FMT[fmtIdx]);
34+
} else {
35+
if (findMatch) {
36+
fmtIdx++;
37+
findMatch = false;
38+
}
39+
stringBuilder.append(chr);
40+
}
41+
if (fmtIdx == FMT.length - 1 && i < src.length() - 1) {
42+
stringBuilder.append(src.substring(i + 1));
43+
break;
44+
}
45+
}
46+
return stringBuilder.toString();
47+
}
48+
49+
}

0 commit comments

Comments
 (0)