2024-11-22 16:41:04 +08:00
|
|
|
// Package orm define database data struct
|
|
|
|
|
package orm
|
|
|
|
|
|
2025-11-19 17:44:08 +08:00
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
"github.com/gofrs/uuid"
|
|
|
|
|
)
|
2024-11-22 16:41:04 +08:00
|
|
|
|
|
|
|
|
// Topologic structure define topologic info set of circuit diagram
|
|
|
|
|
type Topologic struct {
|
2025-11-19 17:44:08 +08:00
|
|
|
ID int64 `gorm:"column:id"`
|
|
|
|
|
UUIDFrom uuid.UUID `gorm:"column:uuid_from"`
|
|
|
|
|
UUIDTo uuid.UUID `gorm:"column:uuid_to"`
|
|
|
|
|
Context JSONMap `gorm:"column:context;type:jsonb;default:'{}'"`
|
|
|
|
|
Flag int `gorm:"column:flag"`
|
|
|
|
|
Description string `gorm:"column:description;size:512;not null;default:''"`
|
|
|
|
|
Op int `gorm:"column:op;not null;default:-1"`
|
|
|
|
|
Ts time.Time `gorm:"column:ts;type:timestamptz;not null;default:CURRENT_TIMESTAMP"`
|
2024-11-22 16:41:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TableName func respresent return table name of Page
|
|
|
|
|
func (t *Topologic) TableName() string {
|
2025-11-19 17:44:08 +08:00
|
|
|
return "topologic"
|
2024-11-22 16:41:04 +08:00
|
|
|
}
|