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:]