2024-11-22 16:41:04 +08:00
|
|
|
// Package orm define database data struct
|
|
|
|
|
package orm
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/gofrs/uuid"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Component structure define abstracted info set of electrical component
|
|
|
|
|
type Component struct {
|
|
|
|
|
ID int64 `gorm:"column:id"`
|
2024-12-05 14:57:23 +08:00
|
|
|
GlobalUUID uuid.UUID `gorm:"column:global_uuid;primaryKey"`
|
2024-11-22 16:41:04 +08:00
|
|
|
GridID int64 `gorm:"column:grid"`
|
|
|
|
|
ZoneID int64 `gorm:"column:zone"`
|
|
|
|
|
StationID int64 `gorm:"column:station"`
|
|
|
|
|
ComponentType int `gorm:"column:type"`
|
|
|
|
|
State int `gorm:"column:state"`
|
|
|
|
|
ConnectedBus int `gorm:"column:connected_bus"`
|
|
|
|
|
Name string `gorm:"column:name"`
|
|
|
|
|
VisibleID string `gorm:"column:visible_id"`
|
|
|
|
|
Description string `gorm:"column:description"`
|
|
|
|
|
Context string `gorm:"column:context"`
|
|
|
|
|
Comment string `gorm:"column:comment"`
|
|
|
|
|
InService bool `gorm:"column:in_service"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TableName func respresent return table name of Component
|
|
|
|
|
func (c *Component) TableName() string {
|
|
|
|
|
return "Component"
|
|
|
|
|
}
|