From 3babf67cdeee87f9077e038bd9d8c5b0a818b586 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:08:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=9A=84=E5=AD=97=E6=AE=B5PreClose,=E4=B8=BALastClose?= =?UTF-8?q?,=E8=A1=A8=E7=A4=BA=E6=9C=80=E6=96=B0=E4=BB=B7(=E6=98=A8?= =?UTF-8?q?=E6=97=A5=E6=94=B6=E7=9B=98=E4=BB=B7,=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E5=92=8C=E5=9F=BA=E9=87=91=E6=9C=89=E6=95=88,=E4=B8=AA?= =?UTF-8?q?=E8=82=A1=E6=97=A0=E6=95=88)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocol/model_code.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/protocol/model_code.go b/protocol/model_code.go index 501982d..3c7c8ee 100644 --- a/protocol/model_code.go +++ b/protocol/model_code.go @@ -11,11 +11,11 @@ type CodeResp struct { } type Code struct { - Name string //股票名称 - Code string //股票代码 - Multiple uint16 //倍数,基本是0x64=100 - Decimal int8 //小数点,基本是2 - PreClose float64 //未知 + Name string //股票名称 + Code string //股票代码 + Multiple uint16 //倍数,基本是0x64=100 + Decimal int8 //小数点,基本是2 + LastPrice float64 //昨收价格,单位元,对个股无效,对指数有效,对其他未知 } func (this *Code) String() string { @@ -45,11 +45,11 @@ func (code) Decode(bs []byte) (*CodeResp, error) { for i := uint16(0); i < resp.Count; i++ { sec := &Code{ - Code: string(bs[:6]), - Multiple: Uint16(bs[6:8]), - Name: string(UTF8ToGBK(bs[8:16])), - Decimal: int8(bs[20]), - PreClose: getVolume(Uint32(bs[21:25])), + Code: string(bs[:6]), + Multiple: Uint16(bs[6:8]), + Name: string(UTF8ToGBK(bs[8:16])), + Decimal: int8(bs[20]), + LastPrice: getVolume(Uint32(bs[21:25])), } //logs.Debug(bs[25:29]) //26和28字节 好像是枚举(基本是44,45和34,35) bs = bs[29:]