ok
This commit is contained in:
31
schema/money_total.go
Normal file
31
schema/money_total.go
Normal file
@@ -0,0 +1,31 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user