增加存储字段,小数点,倍数,和昨收价(对指数有效,个股无效)

This commit is contained in:
钱纯净
2025-03-15 15:05:10 +08:00
parent 4d8d9f1ad9
commit 1d552a0fc7

View File

@@ -123,6 +123,9 @@ func (this *Codes) Code(byDatabase bool) ([]*CodeModel, error) {
Name: v.Name, Name: v.Name,
Code: v.Code, Code: v.Code,
Exchange: exchange.String(), Exchange: exchange.String(),
Multiple: v.Multiple,
Decimal: v.Decimal,
LastPrice: v.LastPrice,
}) })
} }
} else { } else {
@@ -130,6 +133,9 @@ func (this *Codes) Code(byDatabase bool) ([]*CodeModel, error) {
Name: v.Name, Name: v.Name,
Code: v.Code, Code: v.Code,
Exchange: exchange.String(), Exchange: exchange.String(),
Multiple: v.Multiple,
Decimal: v.Decimal,
LastPrice: v.LastPrice,
} }
insert = append(insert, code) insert = append(insert, code)
list = append(list, code) list = append(list, code)
@@ -164,6 +170,9 @@ type CodeModel struct {
Name string `json:"name"` //名称,有时候名称会变,例STxxx Name string `json:"name"` //名称,有时候名称会变,例STxxx
Code string `json:"code" xorm:"index"` //代码 Code string `json:"code" xorm:"index"` //代码
Exchange string `json:"exchange" xorm:"index"` //交易所 Exchange string `json:"exchange" xorm:"index"` //交易所
Multiple uint16 `json:"multiple"` //倍数
Decimal int8 `json:"decimal"` //小数位
LastPrice float64 `json:"lastPrice"` //昨收价格
EditDate int64 `json:"editDate" xorm:"updated"` //修改时间 EditDate int64 `json:"editDate" xorm:"updated"` //修改时间
InDate int64 `json:"inDate" xorm:"created"` //创建时间 InDate int64 `json:"inDate" xorm:"created"` //创建时间
} }