mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
[fix] 修改pg sql
This commit is contained in:
@@ -25,6 +25,11 @@ var (
|
|||||||
activeConnections sync.Map
|
activeConnections sync.Map
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
AEPTYPE = "AEP"
|
||||||
|
ONENETTYPE = "ONENET"
|
||||||
|
)
|
||||||
|
|
||||||
func InitHttpHook(addr string, hs *hook_message_work.HookService) {
|
func InitHttpHook(addr string, hs *hook_message_work.HookService) {
|
||||||
server := NewHttpServer(addr)
|
server := NewHttpServer(addr)
|
||||||
service := &HookHttpService{
|
service := &HookHttpService{
|
||||||
@@ -70,6 +75,7 @@ func basicAuthenticate(req *restful.Request, resp *restful.Response, chain *rest
|
|||||||
func (hhs *HookHttpService) hook(req *restful.Request, resp *restful.Response) {
|
func (hhs *HookHttpService) hook(req *restful.Request, resp *restful.Response) {
|
||||||
token := req.PathParameter("token")
|
token := req.PathParameter("token")
|
||||||
pathType := req.PathParameter("pathType")
|
pathType := req.PathParameter("pathType")
|
||||||
|
platformType := req.QueryParameter("platformType")
|
||||||
if token == "" || pathType == "" {
|
if token == "" || pathType == "" {
|
||||||
resp.Write([]byte("路径未识别token,或上报类型"))
|
resp.Write([]byte("路径未识别token,或上报类型"))
|
||||||
return
|
return
|
||||||
@@ -88,9 +94,13 @@ func (hhs *HookHttpService) hook(req *restful.Request, resp *restful.Response) {
|
|||||||
activeConnections.Store(req.Request.RemoteAddr, etoken)
|
activeConnections.Store(req.Request.RemoteAddr, etoken)
|
||||||
data := netbase.CreateConnectionInfo(message.ConnectMes, "http", req.Request.RemoteAddr, req.Request.RemoteAddr, etoken)
|
data := netbase.CreateConnectionInfo(message.ConnectMes, "http", req.Request.RemoteAddr, req.Request.RemoteAddr, etoken)
|
||||||
go hhs.HookService.Queue.Queue(data)
|
go hhs.HookService.Queue.Queue(data)
|
||||||
|
}
|
||||||
|
var data *netbase.DeviceEventInfo
|
||||||
|
if platformType == AEPTYPE {
|
||||||
|
|
||||||
}
|
}
|
||||||
marshal, _ := json.Marshal(upData)
|
marshal, _ := json.Marshal(upData)
|
||||||
data := &netbase.DeviceEventInfo{
|
data = &netbase.DeviceEventInfo{
|
||||||
Datas: string(marshal),
|
Datas: string(marshal),
|
||||||
DeviceAuth: etoken,
|
DeviceAuth: etoken,
|
||||||
DeviceId: etoken.DeviceId,
|
DeviceId: etoken.DeviceId,
|
||||||
|
|||||||
@@ -513,7 +513,7 @@ CREATE TABLE "public"."device_groups" (
|
|||||||
"path" varchar(255) COLLATE "pg_catalog"."default",
|
"path" varchar(255) COLLATE "pg_catalog"."default",
|
||||||
"description" varchar(255) COLLATE "pg_catalog"."default",
|
"description" varchar(255) COLLATE "pg_catalog"."default",
|
||||||
"sort" int4,
|
"sort" int4,
|
||||||
"ext" json COLLATE "pg_catalog"."default",
|
"ext" json,
|
||||||
"status" varchar(1) COLLATE "pg_catalog"."default"
|
"status" varchar(1) COLLATE "pg_catalog"."default"
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
@@ -552,7 +552,7 @@ CREATE TABLE "public"."devices" (
|
|||||||
"description" varchar(255) COLLATE "pg_catalog"."default",
|
"description" varchar(255) COLLATE "pg_catalog"."default",
|
||||||
"status" varchar(1) COLLATE "pg_catalog"."default",
|
"status" varchar(1) COLLATE "pg_catalog"."default",
|
||||||
"ota_version" varchar(64) COLLATE "pg_catalog"."default",
|
"ota_version" varchar(64) COLLATE "pg_catalog"."default",
|
||||||
"ext" json COLLATE "pg_catalog"."default",
|
"ext" json,
|
||||||
"parent_id" varchar(64) COLLATE "pg_catalog"."default",
|
"parent_id" varchar(64) COLLATE "pg_catalog"."default",
|
||||||
"device_type" varchar(64) COLLATE "pg_catalog"."default",
|
"device_type" varchar(64) COLLATE "pg_catalog"."default",
|
||||||
"link_status" varchar(10) COLLATE "pg_catalog"."default",
|
"link_status" varchar(10) COLLATE "pg_catalog"."default",
|
||||||
|
|||||||
Reference in New Issue
Block a user