[fix] 修改pg sql

This commit is contained in:
PandaX
2023-12-14 10:38:11 +08:00
parent 307b1cdb7c
commit bd6656b537
2 changed files with 13 additions and 3 deletions

View File

@@ -25,6 +25,11 @@ var (
activeConnections sync.Map
)
const (
AEPTYPE = "AEP"
ONENETTYPE = "ONENET"
)
func InitHttpHook(addr string, hs *hook_message_work.HookService) {
server := NewHttpServer(addr)
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) {
token := req.PathParameter("token")
pathType := req.PathParameter("pathType")
platformType := req.QueryParameter("platformType")
if token == "" || pathType == "" {
resp.Write([]byte("路径未识别token或上报类型"))
return
@@ -88,9 +94,13 @@ func (hhs *HookHttpService) hook(req *restful.Request, resp *restful.Response) {
activeConnections.Store(req.Request.RemoteAddr, etoken)
data := netbase.CreateConnectionInfo(message.ConnectMes, "http", req.Request.RemoteAddr, req.Request.RemoteAddr, etoken)
go hhs.HookService.Queue.Queue(data)
}
var data *netbase.DeviceEventInfo
if platformType == AEPTYPE {
}
marshal, _ := json.Marshal(upData)
data := &netbase.DeviceEventInfo{
data = &netbase.DeviceEventInfo{
Datas: string(marshal),
DeviceAuth: etoken,
DeviceId: etoken.DeviceId,

View File

@@ -513,7 +513,7 @@ CREATE TABLE "public"."device_groups" (
"path" varchar(255) COLLATE "pg_catalog"."default",
"description" varchar(255) COLLATE "pg_catalog"."default",
"sort" int4,
"ext" json COLLATE "pg_catalog"."default",
"ext" json,
"status" varchar(1) COLLATE "pg_catalog"."default"
)
;
@@ -552,7 +552,7 @@ CREATE TABLE "public"."devices" (
"description" varchar(255) COLLATE "pg_catalog"."default",
"status" varchar(1) 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",
"device_type" varchar(64) COLLATE "pg_catalog"."default",
"link_status" varchar(10) COLLATE "pg_catalog"."default",