modelRT/orm/demo.go

38 lines
1.1 KiB
Go
Raw Normal View History

2024-12-18 16:25:49 +08:00
// Package orm define database data struct
package orm
import "github.com/gofrs/uuid"
type Demo struct {
// 母线基本参数
DemoName string // 母线端名称,默认值BusX
BusbarNumber int // 母线编号,默认值1
Resistance float32 // 电阻值
Voltage float32 // 电压(测点)
AnchorVoltage bool // 是否锚定电压
VoltageUpperLimit float32 // 电压上限
VoltageLowerLimit float32 // 电压下限
Current float32 // 电流(测点)
AnchorCurrent bool // 是否锚定电流
CurrentUpperLimit float32 // 电流上限
CurrentLowerLimit float32 // 电流下限
AnchorParaList string // 锚定参量列表
UUID uuid.UUID `gorm:"column:global_uuid;primaryKey"`
}
// TableName func respresent return table name of busbar section
func (d *Demo) TableName() string {
return "Demo"
}
// SetUUID func implement BasicModelInterface interface
func (d *Demo) SetUUID(uuid uuid.UUID) {
d.UUID = uuid
return
}
// ReturnTableName func implement BasicModelInterface interface
func (d *Demo) ReturnTableName() string {
return "Demo"
}