Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
7abfda05
Commit
7abfda05
authored
Jun 30, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amos-boot-module-jxiop-monitor-bize 支持influxdb
parent
5a25666e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
10 deletions
+33
-10
pom.xml
...t-system-jxiop/amos-boot-module-jxiop-monitor-biz/pom.xml
+4
-3
DemoController.java
...amos/boot/module/jxiop/biz/controller/DemoController.java
+25
-3
application-dev.properties
...monitor-biz/src/main/resources/application-dev.properties
+4
-4
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/pom.xml
View file @
7abfda05
...
...
@@ -32,9 +32,10 @@
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-activemq
</artifactId>
<version>
2.5.4
</version>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-component-influxdb
</artifactId>
<version>
1.8.5-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/DemoController.java
View file @
7abfda05
...
...
@@ -8,8 +8,10 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.Test
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.StationBasicServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.TestServiceImpl
;
import
com.yeejoin.amos.component.influxdb.InfluxDbConnection
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.influxdb.dto.QueryResult
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
...
...
@@ -32,18 +34,38 @@ public class DemoController extends BaseController {
@Autowired
StationBasicMapper
stationBasicMapper
;
@Autowired
InfluxDbConnection
influxDbConnection
;
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"demo测试"
)
@ApiOperation
(
value
=
"demo测试
prodcutcion 库
"
)
@GetMapping
(
"/test"
)
public
StationBasic
demoTest
()
{
return
stationBasicServiceimpl
.
getById
(
1660231556607774721L
);
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"demo测试
1
"
)
@ApiOperation
(
value
=
"demo测试
中间库
"
)
@GetMapping
(
"/test1"
)
public
List
<
Test
>
demoTest1
()
{
return
testServiceimpl
.
getList
();
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"demo测试influxdb"
)
@GetMapping
(
"/test3"
)
public
void
demoTest2
()
{
QueryResult
query
=
influxDbConnection
.
query
(
"select * from iot_data where time> now()-1s"
);
List
<
QueryResult
.
Result
>
queryResults
=
query
.
getResults
();
for
(
int
i
=
0
;
i
<
queryResults
.
size
()
;
i
++)
{
QueryResult
.
Result
result
=
queryResults
.
get
(
i
);
List
list
=
result
.
getSeries
();
for
(
int
j
=
0
;
j
<
list
.
size
()
;
j
++)
{
QueryResult
.
Series
series
=
(
QueryResult
.
Series
)
list
.
get
(
j
);
System
.
out
.
println
(
series
.
getName
());
System
.
out
.
println
(
series
.
getColumns
());
System
.
out
.
println
(
series
.
getValues
());
System
.
out
.
println
(
series
.
getTags
());
}
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/resources/application-dev.properties
View file @
7abfda05
...
...
@@ -108,16 +108,16 @@ emqx.password=a123456
emqx.max-inflight
=
1000
spring.influx.url
=
http://39.98.246.31:8086
spring.influx.password
=
Yeejoin@2020
spring.influx.user
=
root
# influxDB
spring.influx.url
=
http://139.9.170.47:8086
spring.influx.password
=
admin
spring.influx.user
=
admin
spring.influx.database
=
iot_platform
spring.influx.retention_policy
=
default
spring.influx.retention_policy_time
=
30d
spring.influx.actions
=
10000
spring.influx.bufferLimit
=
20000
knife4j.production
=
false
knife4j.enable
=
true
knife4j.basic.enable
=
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment