[优化]大改动,指令下发采用规则链rpc请求

This commit is contained in:
PandaX
2023-10-14 10:00:05 +08:00
parent 42be3b23e4
commit 7c8001a687
54 changed files with 1256 additions and 294 deletions

View File

@@ -4,13 +4,13 @@ import (
"database/sql/driver"
"encoding/json"
"errors"
"pandax/pkg/global"
"pandax/pkg/global_model"
"time"
)
// DeviceGroup 设备分组
type DeviceGroup struct {
global.BaseAuthModel
global_model.BaseAuthModel
Name string `json:"name" gorm:"type:varchar(128);comment:设备分组名称" validate:"required"`
Pid string `json:"pid" gorm:"type:varchar(64);comment:设备分组类型"`
Path string `json:"path" gorm:"type:varchar(255);comment:设备分组路径"`
@@ -30,7 +30,7 @@ type DeviceGroupLabel struct {
}
type Device struct {
global.BaseAuthModel
global_model.BaseAuthModel
Name string `json:"name" gorm:"type:varchar(128);comment:设备名称" validate:"required,alphanum"` // mqtt 用户名英文
ParentId string `json:"parentId" gorm:"type:varchar(64);comment:父设备"`
DeviceType string `json:"deviceType" gorm:"type:varchar(64);comment:设备类型"`