Commit 0a0b243c authored by sven's avatar sven

增加净化设施数据接收

parent 27d796be
......@@ -174,6 +174,11 @@ dtuServer:
addr: 0.0.0.0:9804
enable: true
# 净化设备配置
mqttServer:
addr: 47.111.122.176:1883
enable: true
# 莹石云帐号
yinShiYun:
13625717783:
......
......@@ -174,6 +174,11 @@ dtuServer:
addr: 0.0.0.0:9804
enable: false
# 净化设备配置
mqttServer:
addr: 47.111.122.176:1883
enable: false
# 莹石云帐号
yinShiYun:
13625717783:
......
......@@ -174,6 +174,11 @@ dtuServer:
addr: 0.0.0.0:9804
enable: false
# 净化设备配置
mqttServer:
addr: 47.111.122.176:1883
enable: true
# 莹石云帐号
yinShiYun:
13625717783:
......
......@@ -11,6 +11,7 @@ require (
github.com/beego/beego/v2 v2.0.5
github.com/casbin/casbin/v2 v2.11.0
github.com/casbin/gorm-adapter/v3 v3.0.2
github.com/eclipse/paho.mqtt.golang v1.4.2 // indirect
github.com/flipped-aurora/ws v1.0.2
github.com/fsnotify/fsnotify v1.4.9
github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6
......
......@@ -147,6 +147,8 @@ github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25Kn
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/eclipse/paho.mqtt.golang v1.4.2 h1:66wOzfUHSSI1zamx7jR6yMEI5EuHnT1G6rNA5PM12m4=
github.com/eclipse/paho.mqtt.golang v1.4.2/go.mod h1:JGt0RsEwEX+Xa/agj90YJ9d9DH2b7upDZMK9HRbFvCA=
github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
github.com/elastic/go-elasticsearch/v6 v6.8.10/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
......@@ -911,6 +913,7 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
......
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 10:35:22.357 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:37 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 10:35:22.359 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:79 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 10:35:22.359 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 10:40:44.281 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:37 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 10:40:44.283 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:79 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 10:40:44.283 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 11:10:36.843 info /Users/honghuiliu/go/project/qsh-wc/server/api/v1/system/sys_initdb.go:57 前往初始化数据库
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:33:21.225 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:61 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:33:21.243 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:37 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:33:21.245 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:79 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:33:21.245 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:43:42.498 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:43:42.518 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:43:42.520 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:43:42.520 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:49:02.795 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:49:02.812 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:49:02.825 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:49:02.825 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 08:40:05.875 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 08:40:05.894 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 08:40:05.895 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 08:40:05.895 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 09:58:38.459 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 09:58:38.478 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 09:58:38.490 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 09:58:38.490 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:04:37.657 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:04:37.674 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:04:37.697 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:04:37.697 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:11:07.363 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:11:07.385 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:11:07.401 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:11:07.402 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:43:44.251 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:43:44.265 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:43:44.271 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:43:44.271 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:52:17.674 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:52:17.691 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:52:17.699 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:52:17.699 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:53:12.944 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:53:12.959 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:53:12.966 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:53:12.966 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:23.920 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:25.247 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:25.256 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:25.260 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:25.260 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:30.910 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:32.639 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:32.652 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:32.656 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:32.656 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:52.282 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:54.014 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:54.040 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:54.041 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:54.041 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:05:21.701 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:05:23.691 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:05:23.705 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:05:23.710 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:05:23.710 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:06:32.671 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:06:34.751 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:06:34.767 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:06:34.768 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:06:34.768 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:15.555 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:17.774 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:17.790 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:17.792 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:17.792 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:55.220 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:57.403 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:57.418 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:57.422 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:57.422 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:11:02.764 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:11:04.485 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:11:04.503 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:11:04.523 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:11:04.523 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:26:59.002 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:27:01.367 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:27:01.381 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:27:01.393 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:27:01.394 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:33:17.156 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:33:19.920 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:33:19.936 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:33:19.939 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:33:19.939 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:35:22.752 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:35:26.799 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:35:26.828 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:35:26.830 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:35:26.830 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:36:12.245 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:36:15.683 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:36:15.735 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:36:15.737 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:36:15.737 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:03.071 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:06.531 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:06.549 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:06.553 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:06.553 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:46.579 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:49.878 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:49.894 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:49.897 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:49.897 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:56.546 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:59.741 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:59.767 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:59.769 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:59.769 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:40:16.273 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:40:19.323 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:40:19.340 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:40:19.343 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:40:19.343 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:41:45.165 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:41:49.408 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:41:49.433 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:41:49.436 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:41:49.436 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:42:43.710 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:42:48.217 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:42:48.239 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:42:48.242 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:42:48.242 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:46:19.061 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:46:51.650 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:47:04.615 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:47:04.646 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:47:04.649 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:47:04.650 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:29:22.082 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:29:23.572 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:29:23.583 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:29:23.590 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:29:23.590 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:32:46.023 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:32:48.749 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:32:48.764 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:32:48.770 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:32:48.771 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:34:29.101 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:34:31.452 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:34:31.463 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:34:31.465 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:34:31.465 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:19:59.763 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:20:02.219 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:20:02.235 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:20:02.237 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:20:02.237 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:35:45.528 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:35:47.030 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:35:47.041 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:35:47.050 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:35:47.050 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:59:57.123 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:59:58.919 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:59:58.931 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:59:58.939 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:59:58.939 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
package main
import (
"fmt"
"github.com/flipped-aurora/gin-vue-admin/server/core"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/initialize"
......@@ -22,6 +24,7 @@ import (
// @name x-token
// @BasePath /
func main() {
global.GVA_VP = core.Viper() // 初始化Viper
global.GVA_LOG = core.Zap() // 初始化zap日志库
zap.ReplaceGlobals(global.GVA_LOG)
......@@ -44,5 +47,14 @@ func main() {
})
go server.InitDtuServer(global.GVA_VP.GetString("dtuServer.addr"))
}
// 净化设施服务
if global.GVA_VP.GetBool("mqttServer.enable") {
server.OnMqttMessage(func(data server.JingHuaData) error {
// {301022041237 {"MBR池溶氧值":0,"出水池PH值":4,"出水池流量值":0,"厌氧池PH值":4,"好氧池PH值":4.0,"好氧池溶氧值":0,"调节池流量值":0.1}}
fmt.Println(data)
return nil
})
go server.InitJinghuaServer(global.GVA_VP.GetString("mqttServer.addr"))
}
core.RunWindowsServer()
}
package server
import (
"log"
"os"
"strings"
"time"
MQTT "github.com/eclipse/paho.mqtt.golang"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/admin"
)
//define a function for the default message handler
var f MQTT.MessageHandler = func(client MQTT.Client, msg MQTT.Message) {
if jingHuaCb != nil {
jingHuaCb(JingHuaData{
strings.Replace(msg.Topic(), "Monitor/", "", 1),
string(msg.Payload()),
})
}
// fmt.Printf("TOPIC: %s\n", msg.Topic())
// fmt.Printf("MSG: %s\n", msg.Payload())
}
type JingHuaData struct {
JinghuaDeviceId string
Data string
}
type JingHuaCb func(data JingHuaData) error
var jingHuaCb JingHuaCb
func InitJinghuaServer(address string) {
opts := MQTT.NewClientOptions().AddBroker("tcp://" + address)
opts.SetClientID("dangliang")
opts.SetDefaultPublishHandler(f)
opts.SetPingTimeout(1 * time.Second)
opts.SetKeepAlive(60 * time.Second)
MQTT.ERROR = log.New(os.Stdout, "", 0)
c := MQTT.NewClient(opts)
if token := c.Connect(); token.Wait() && token.Error() != nil {
panic(token.Error())
}
// 从数据库中动态读取设备id,通过设备id订阅
var toilets []admin.QshToilet
err := global.GVA_DB.
Where("jinghua_device_id IS NOT NULL AND jinghua_device_id <> ''").
Where("type = 1").
Find(&toilets).Error
if err != nil {
global.GVA_LOG.Error(err.Error())
os.Exit(1)
}
for _, toilet := range toilets {
if token := c.Subscribe("Monitor/"+toilet.JinghuaDeviceId, 0, nil); token.Wait() && token.Error() != nil {
global.GVA_LOG.Error(token.Error().Error())
os.Exit(1)
}
}
defer c.Disconnect(250)
log.Println("Mqtt client is running!")
select {}
}
// OnMqttMessage 注册回调函数
func OnMqttMessage(cb JingHuaCb) {
jingHuaCb = cb
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment