[优化]设备数据上传并发处理,添加队列,以及并发数控制

This commit is contained in:
PandaX
2023-11-28 17:59:01 +08:00
parent 58341b0236
commit 287c8a1b05
8 changed files with 45 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
package netbase
import (
"encoding/json"
"pandax/pkg/global/model"
)
@@ -11,3 +12,11 @@ type DeviceEventInfo struct {
Type string `json:"type"`
RequestId string `json:"requestId"`
}
func (j *DeviceEventInfo) Bytes() []byte {
b, err := json.Marshal(j)
if err != nil {
panic(err)
}
return b
}