mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-05-07 04:21:25 +08:00
[优化]优化目录
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
"pandax/iothub/hook_message_work"
|
||||
"pandax/iothub/netbase"
|
||||
"pandax/pkg/global"
|
||||
"pandax/pkg/global_model"
|
||||
"pandax/pkg/global/model"
|
||||
"pandax/pkg/rule_engine/message"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -42,7 +42,7 @@ func InitHttpHook(addr string, hs *hook_message_work.HookService) {
|
||||
case http.StateHijacked, http.StateClosed:
|
||||
etoken, _ := activeConnections.Load(conn.RemoteAddr().String())
|
||||
if etoken != nil {
|
||||
data := netbase.CreateConnectionInfo(message.DisConnectMes, "http", conn.RemoteAddr().String(), conn.RemoteAddr().String(), etoken.(*global_model.DeviceAuth))
|
||||
data := netbase.CreateConnectionInfo(message.DisConnectMes, "http", conn.RemoteAddr().String(), conn.RemoteAddr().String(), etoken.(*model.DeviceAuth))
|
||||
activeConnections.Delete(conn.RemoteAddr().String())
|
||||
service.HookService.MessageCh <- data
|
||||
}
|
||||
@@ -80,7 +80,7 @@ func (hhs *HookHttpService) hook(req *restful.Request, resp *restful.Response) {
|
||||
resp.Write([]byte("解析上报参数失败"))
|
||||
return
|
||||
}
|
||||
etoken := &global_model.DeviceAuth{}
|
||||
etoken := &model.DeviceAuth{}
|
||||
etoken.GetDeviceToken(token)
|
||||
_, ok := activeConnections.Load(req.Request.RemoteAddr)
|
||||
// 是否需要添加设备上线通知
|
||||
|
||||
Reference in New Issue
Block a user