From 1d552a0fc7198a76dab9d2d8d8a34f2a6853048e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E7=BA=AF=E5=87=80?= <1113655791@qq.com> Date: Sat, 15 Mar 2025 15:05:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=98=E5=82=A8=E5=AD=97?= =?UTF-8?q?=E6=AE=B5,=E5=B0=8F=E6=95=B0=E7=82=B9,=E5=80=8D=E6=95=B0,?= =?UTF-8?q?=E5=92=8C=E6=98=A8=E6=94=B6=E4=BB=B7(=E5=AF=B9=E6=8C=87?= =?UTF-8?q?=E6=95=B0=E6=9C=89=E6=95=88,=E4=B8=AA=E8=82=A1=E6=97=A0?= =?UTF-8?q?=E6=95=88)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codes.go | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/codes.go b/codes.go index 66beb95..a3ed495 100644 --- a/codes.go +++ b/codes.go @@ -120,16 +120,22 @@ func (this *Codes) Code(byDatabase bool) ([]*CodeModel, error) { if mCode[v.Code].Name != v.Name { mCode[v.Code].Name = v.Name update = append(update, &CodeModel{ - Name: v.Name, - Code: v.Code, - Exchange: exchange.String(), + Name: v.Name, + Code: v.Code, + Exchange: exchange.String(), + Multiple: v.Multiple, + Decimal: v.Decimal, + LastPrice: v.LastPrice, }) } } else { code := &CodeModel{ - Name: v.Name, - Code: v.Code, - Exchange: exchange.String(), + Name: v.Name, + Code: v.Code, + Exchange: exchange.String(), + Multiple: v.Multiple, + Decimal: v.Decimal, + LastPrice: v.LastPrice, } insert = append(insert, code) list = append(list, code) @@ -160,12 +166,15 @@ func (this *Codes) Code(byDatabase bool) ([]*CodeModel, error) { } type CodeModel struct { - ID int64 `json:"id"` //主键 - Name string `json:"name"` //名称,有时候名称会变,例STxxx - Code string `json:"code" xorm:"index"` //代码 - Exchange string `json:"exchange" xorm:"index"` //交易所 - EditDate int64 `json:"editDate" xorm:"updated"` //修改时间 - InDate int64 `json:"inDate" xorm:"created"` //创建时间 + ID int64 `json:"id"` //主键 + Name string `json:"name"` //名称,有时候名称会变,例STxxx + Code string `json:"code" 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"` //修改时间 + InDate int64 `json:"inDate" xorm:"created"` //创建时间 } func (c *CodeModel) TableName() string {