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 {
|
2025-11-19 17:44:08 +08:00
|
|
|
ID int64 `gorm:"column:id;primaryKey"`
|
|
|
|
|
TAGNAME string `gorm:"column:tagname"`
|
|
|
|
|
Name string `gorm:"column:name"`
|
|
|
|
|
Description string `gorm:"column:description"`
|
|
|
|
|
Op int `gorm:"column:op"`
|
|
|
|
|
Ts time.Time `gorm:"column:ts"`
|
2025-07-31 16:52:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TableName func respresent return table name of Grid
|
|
|
|
|
func (g *Grid) TableName() string {
|
2025-11-19 17:44:08 +08:00
|
|
|
return "grid"
|
2025-07-31 16:52:21 +08:00
|
|
|
}
|