32 lines
866 B
Go
32 lines
866 B
Go
package schema
|
|
|
|
// MoneyTotal 资金流汇总(采用 dataset/stock 的索引定义)。
|
|
type MoneyTotal struct {
|
|
ID uint `gorm:"primarykey"`
|
|
Code string `gorm:"type:varchar(20);not null;uniqueIndex:uq_money_total_code"`
|
|
Last1DayMfAmount float64
|
|
Last3DayMfAmount float64
|
|
Last1DayTotalAmount float64
|
|
Last3DayTotalAmount float64
|
|
IsGreaterPervious bool
|
|
}
|
|
|
|
func (MoneyTotal) TableName() string {
|
|
return "money_total"
|
|
}
|
|
|
|
// Key 与唯一索引 uq_money_total_code 一致。
|
|
func (m *MoneyTotal) Key() string {
|
|
return m.Code
|
|
}
|
|
|
|
// NetFlow1Day 最近 1 日主力净流入(万元),与字段语义一致。
|
|
func (m *MoneyTotal) NetFlow1Day() float64 {
|
|
return m.Last1DayMfAmount
|
|
}
|
|
|
|
// NetFlow3Day 最近 3 日主力净流入(万元)。
|
|
func (m *MoneyTotal) NetFlow3Day() float64 {
|
|
return m.Last3DayMfAmount
|
|
}
|