2025-07-31 16:52:21 +08:00
|
|
|
// Package orm define database data struct
|
|
|
|
|
package orm
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Grid structure define abstracted info set of electrical grid
|
|
|
|
|
type Grid struct {
|
|
|
|
|
ID int64 `gorm:"column:ID;primaryKey"`
|
2025-08-26 17:09:49 +08:00
|
|
|
TAGNAME string `gorm:"column:TAGNAME"`
|
2025-07-31 16:52:21 +08:00
|
|
|
Name string `gorm:"column:NAME"`
|
|
|
|
|
Description string `gorm:"column:DESCRIPTION"`
|
|
|
|
|
Op int `gorm:"column:OP"`
|
|
|
|
|
Ts time.Time `gorm:"column:TS"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TableName func respresent return table name of Grid
|
|
|
|
|
func (g *Grid) TableName() string {
|
|
|
|
|
return "GRID"
|
|
|
|
|
}
|