Skip to content

Commit 46778db

Browse files
committed
初始化提交,支持增删改查
1 parent 7c03e04 commit 46778db

File tree

5 files changed

+482
-25
lines changed

5 files changed

+482
-25
lines changed

.gitignore

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
1-
# Compiled class file
2-
*.class
3-
4-
# Log file
5-
*.log
6-
7-
# BlueJ files
8-
*.ctxt
9-
10-
# Mobile Tools for Java (J2ME)
11-
.mtj.tmp/
12-
13-
# Package Files #
14-
*.jar
15-
*.war
16-
*.nar
17-
*.ear
18-
*.zip
19-
*.tar.gz
20-
*.rar
21-
22-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23-
hs_err_pid*
24-
replay_pid*
1+
/target/
2+
.classpath
3+
.project
4+
.settings
5+
.idea
6+
*.iml

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright ©2021 APIJSON(https://github.com/APIJSON)
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# apijson-iotdb [![](https://jitpack.io/v/APIJSON/apijson-iotdb.svg)](https://jitpack.io/#APIJSON/apijson-iotdb)
2+
腾讯 [APIJSON](https://github.com/Tencent/APIJSON) 7.0.3+ 的 IoTDB 数据库插件,可通过 Maven, Gradle 等远程依赖。<br />
3+
An IoTDB plugin for Tencent [APIJSON](https://github.com/Tencent/APIJSON) 7.0.3+
4+
5+
![image](https://private-user-images.githubusercontent.com/5738175/397984593-6d088d9c-86d9-40a9-b9fa-b49c679e19a6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzQ4NzQ5NzQsIm5iZiI6MTczNDg3NDY3NCwicGF0aCI6Ii81NzM4MTc1LzM5Nzk4NDU5My02ZDA4OGQ5Yy04NmQ5LTQwYTktYjlmYS1iNDljNjc5ZTE5YTYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MTIyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDEyMjJUMTMzNzU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OWM2OTBmYmM4MmRiYzIwNjg4ZDAzZDkxYjkwMjE4ZDM4NWY1NDFkYTFjNTMyMWQ0MzFlMzkxODhlNDIxNDYyMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.POonQKkSUjGuF1fRF4vbT61mI1wKGmamLTL5Ld7GmxA)
6+
![image](https://github.com/user-attachments/assets/920dd1ea-5490-4c1e-8132-7e1f6324f156)
7+
8+
## 添加依赖
9+
## Add Dependency
10+
11+
### Maven
12+
#### 1. 在 pom.xml 中添加 JitPack 仓库
13+
#### 1. Add the JitPack repository to pom.xml
14+
```xml
15+
<repositories>
16+
<repository>
17+
<id>jitpack.io</id>
18+
<url>https://jitpack.io</url>
19+
</repository>
20+
</repositories>
21+
```
22+
23+
![image](https://user-images.githubusercontent.com/5738175/167261814-d75d8fff-0e64-4534-a840-60ef628a8873.png)
24+
25+
<br />
26+
27+
#### 2. 在 pom.xml 中添加 apijson-iotdb 依赖
28+
#### 2. Add the apijson-iotdb dependency to pom.xml
29+
```xml
30+
<dependency>
31+
<groupId>com.github.APIJSON</groupId>
32+
<artifactId>apijson-iotdb</artifactId>
33+
<version>LATEST</version>
34+
</dependency>
35+
```
36+
37+
<br />
38+
39+
https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/pom.xml
40+
41+
<br />
42+
<br />
43+
44+
### Gradle
45+
#### 1. 在项目根目录 build.gradle 中最后添加 JitPack 仓库
46+
#### 1. Add the JitPack repository in your root build.gradle at the end of repositories
47+
```gradle
48+
allprojects {
49+
repositories {
50+
maven { url 'https://jitpack.io' }
51+
}
52+
}
53+
```
54+
<br />
55+
56+
#### 2. 在项目某个 module 目录(例如 `app`) build.gradle 中添加 apijson-iotdb 依赖
57+
#### 2. Add the apijson-iotdb dependency in one of your modules(such as `app`)
58+
```gradle
59+
dependencies {
60+
implementation 'com.github.APIJSON:apijson-iotdb:latest'
61+
}
62+
```
63+
64+
<br />
65+
<br />
66+
<br />
67+
68+
## 使用
69+
## Usage
70+
71+
在你项目继承 AbstractSQLExecutor 的子类重写方法 execute <br/>
72+
Override execute in your SQLExecutor extends AbstractSQLExecutor
73+
74+
```java
75+
@Override
76+
public JSONObject execute(@NotNull SQLConfig<Long> config, boolean unknownType) throws Exception {
77+
if (config.isIoTDB()) {
78+
return InfluxdbUtil.execute(config, null, unknownType);
79+
}
80+
81+
return super.execute(config, unknownType);
82+
}
83+
```
84+
85+
<br/>
86+
在你项目继承 AbstractSQLConfig 的子类重写方法 execute <br/>
87+
Override execute in your SQLConfig extends AbstractSQLConfig
88+
89+
```java
90+
@Override
91+
public String getTablePath() {
92+
return IoTDBUtil.getTablePath(super.getTablePath(), isIoTDB());
93+
}
94+
```
95+
96+
#### [IoTDBUtil](/src/main/java/apijson/iotdb/IoTDBUtil.java) 的注释及 [APIJSONBoot-MultiDataSource](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot-MultiDataSource)[DemoSQLExecutor](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoSQLExecutor.java) <br />
97+
98+
#### See document in [IoTDBUtil](/src/main/java/apijson/iotdb/IoTDBUtil.java) and [DemoSQLExecutor](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoSQLExecutor.java) in [APIJSONBoot-MultiDataSource](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot-MultiDataSource)
99+
100+
<br />
101+
<br />
102+
<br />
103+
104+
有问题可以去 Tencent/APIJSON 提 issue <br />
105+
https://github.com/Tencent/APIJSON/issues/36
106+
107+
<br /><br />
108+
109+
#### 点右上角 ⭐Star 支持一下,谢谢 ^_^
110+
#### Please ⭐Star this project ^_^
111+
https://github.com/APIJSON/apijson-iotdb

pom.xml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>apijson.iotdb</groupId>
7+
<artifactId>apijson-iotdb</artifactId>
8+
<version>1.0.0</version>
9+
<packaging>jar</packaging>
10+
11+
<name>apijson-iotdb</name>
12+
<description>A IoTDB plugin for Tencent APIJSON</description>
13+
14+
<properties>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
17+
<java.version>1.8</java.version>
18+
</properties>
19+
20+
<dependencies>
21+
<!-- APIJSON 需要用的依赖库,1.2.0 以上 -->
22+
<dependency>
23+
<groupId>com.alibaba</groupId>
24+
<artifactId>fastjson</artifactId>
25+
<version>1.2.83</version>
26+
</dependency>
27+
<dependency>
28+
<groupId>com.github.Tencent</groupId>
29+
<artifactId>APIJSON</artifactId>
30+
<version>7.0.3</version>
31+
</dependency>
32+
<dependency>
33+
<groupId>org.apache.iotdb</groupId>
34+
<artifactId>iotdb-session</artifactId>
35+
<version>1.3.1</version>
36+
</dependency>
37+
38+
</dependencies>
39+
40+
<build>
41+
<plugins>
42+
<plugin>
43+
<groupId>org.apache.maven.plugins</groupId>
44+
<artifactId>maven-compiler-plugin</artifactId>
45+
<version>3.8.1</version>
46+
<configuration>
47+
<source>1.8</source>
48+
<target>1.8</target>
49+
</configuration>
50+
</plugin>
51+
</plugins>
52+
</build>
53+
54+
<repositories>
55+
<!-- APIJSON 必须用到的托管平台 -->
56+
<repository>
57+
<id>jitpack.io</id>
58+
<url>https://jitpack.io</url>
59+
<snapshots>
60+
<enabled>true</enabled>
61+
</snapshots>
62+
</repository>
63+
</repositories>
64+
65+
</project>

0 commit comments

Comments
 (0)