mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
[优化]优化目录
This commit is contained in:
@@ -4,13 +4,13 @@ import (
|
||||
"database/sql/driver"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"pandax/pkg/global_model"
|
||||
"pandax/pkg/global/model"
|
||||
"time"
|
||||
)
|
||||
|
||||
// DeviceGroup 设备分组
|
||||
type DeviceGroup struct {
|
||||
global_model.BaseAuthModel
|
||||
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:设备分组路径"`
|
||||
@@ -31,7 +31,7 @@ type DeviceGroupLabel struct {
|
||||
}
|
||||
|
||||
type Device struct {
|
||||
global_model.BaseAuthModel
|
||||
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:设备类型"`
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"database/sql/driver"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"pandax/pkg/global_model"
|
||||
"pandax/pkg/global/model"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -22,7 +22,7 @@ const (
|
||||
)
|
||||
|
||||
type ProductCategory struct {
|
||||
global_model.BaseAuthModel
|
||||
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:产品类型路径"`
|
||||
@@ -39,7 +39,7 @@ type ProductCategoryLabel struct {
|
||||
}
|
||||
|
||||
type Product struct {
|
||||
global_model.BaseAuthModel
|
||||
model.BaseAuthModel
|
||||
Name string `json:"name" gorm:"type:varchar(128);comment:产品名称" validate:"required"`
|
||||
PhotoUrl string `json:"photoUrl" gorm:"type:varchar(255);comment:图片地址"`
|
||||
Description string `json:"description" gorm:"type:varchar(255);comment:产品说明"`
|
||||
@@ -57,7 +57,7 @@ type ProductRes struct {
|
||||
}
|
||||
|
||||
type ProductTemplate struct {
|
||||
global_model.BaseModel
|
||||
model.BaseModel
|
||||
Pid string `json:"pid" gorm:"type:varchar(64);comment:产品Id" validate:"required"`
|
||||
Classify string `json:"classify" gorm:"type:varchar(64);comment:模型归类" validate:"required"` // 属性 遥测 命令 事件
|
||||
Name string `json:"name" gorm:"type:varchar(64);comment:名称" validate:"required"`
|
||||
@@ -68,7 +68,7 @@ type ProductTemplate struct {
|
||||
}
|
||||
|
||||
type ProductOta struct {
|
||||
global_model.BaseModel
|
||||
model.BaseModel
|
||||
Pid string `json:"pid" gorm:"comment:产品Id" validate:"required"`
|
||||
Name string `json:"name" gorm:"type:varchar(64);comment:固件名称" validate:"required"`
|
||||
Version string `json:"version" gorm:"type:varchar(64);comment:固件版本" validate:"required"`
|
||||
|
||||
Reference in New Issue
Block a user