2026-03-13 08:35:54 +00:00
|
|
|
package model
|
|
|
|
|
|
2026-03-19 14:51:31 +00:00
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
"gorm.io/gorm"
|
|
|
|
|
)
|
2026-03-13 08:35:54 +00:00
|
|
|
|
|
|
|
|
type Device struct {
|
|
|
|
|
ID string `json:"id" gorm:"type:varchar(32);primaryKey"`
|
|
|
|
|
|
2026-03-19 14:51:31 +00:00
|
|
|
Name string `json:"name" gorm:"type:varchar(128);not null"`
|
|
|
|
|
ModelID string `json:"modelId" gorm:"type:varchar(32);index"`
|
|
|
|
|
SerialNo string `json:"serialNo" gorm:"type:varchar(64);index"`
|
|
|
|
|
StatusCode string `json:"statusCode" gorm:"type:varchar(64);not null;index"`
|
|
|
|
|
PointID string `json:"pointId" gorm:"type:varchar(32);index"`
|
|
|
|
|
InstalledAt *time.Time `json:"installedAt"`
|
|
|
|
|
InstalledImage string `json:"installedImage" gorm:"type:text;not null"`
|
|
|
|
|
Channel1ParamID string `json:"channel1ParamId" gorm:"type:varchar(32);index"`
|
|
|
|
|
Channel2ParamID string `json:"channel2ParamId" gorm:"type:varchar(32);index"`
|
|
|
|
|
Channel3ParamID string `json:"channel3ParamId" gorm:"type:varchar(32);index"`
|
|
|
|
|
CreatorUserID string `json:"creatorUserId" gorm:"type:varchar(32);not null;index"`
|
|
|
|
|
Remark string `json:"remark" gorm:"type:varchar(255);default:''"`
|
|
|
|
|
DeletedAt gorm.DeletedAt `gorm:"index"`
|
|
|
|
|
CreatedAt time.Time `json:"createdAt" gorm:"autoCreateTime"`
|
|
|
|
|
UpdatedAt time.Time `json:"updatedAt" gorm:"autoUpdateTime"`
|
2026-03-13 08:35:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type DeviceIngestData struct {
|
2026-03-19 14:51:31 +00:00
|
|
|
ID string `json:"id" gorm:"type:varchar(32);primaryKey"`
|
|
|
|
|
DeviceID string `json:"deviceId" gorm:"type:varchar(32);not null;index"`
|
|
|
|
|
PointID string `json:"pointId" gorm:"type:varchar(32);not null;index"`
|
|
|
|
|
Raw1 string `json:"raw1" gorm:"type:varchar(64);default:''"`
|
|
|
|
|
Raw2 string `json:"raw2" gorm:"type:varchar(64);default:''"`
|
|
|
|
|
Raw3 string `json:"raw3" gorm:"type:varchar(64);default:''"`
|
|
|
|
|
Value1 string `json:"value1" gorm:"type:varchar(64);default:''"`
|
|
|
|
|
Value2 string `json:"value2" gorm:"type:varchar(64);default:''"`
|
|
|
|
|
Value3 string `json:"value3" gorm:"type:varchar(64);default:''"`
|
|
|
|
|
CollectedAt time.Time `json:"collectedAt" gorm:"not null;index"`
|
|
|
|
|
DeletedAt gorm.DeletedAt `gorm:"index"`
|
2026-03-13 08:35:54 +00:00
|
|
|
}
|