From 0d1e6b6b51505ab337c4abbe582aecd4d9203315 Mon Sep 17 00:00:00 2001 From: injoyai <1113655791@qq.com> Date: Wed, 26 Nov 2025 16:49:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8C=87=E6=95=B0=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E4=B8=8D=E5=85=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/Codes2/main.go | 9 +++++++++ protocol/unit.go | 2 ++ 2 files changed, 11 insertions(+) diff --git a/example/Codes2/main.go b/example/Codes2/main.go index e78c89d..15861f9 100644 --- a/example/Codes2/main.go +++ b/example/Codes2/main.go @@ -2,6 +2,8 @@ package main import ( "fmt" + "strings" + "github.com/injoyai/logs" "github.com/injoyai/tdx" ) @@ -13,4 +15,11 @@ func main() { c := cs.Get("sz000001") fmt.Println(c.FloatStock, c.TotalStock) + + for _, v := range cs.GetIndexes().Codes() { + if strings.HasPrefix(v, "sz") { + logs.Debug(v) + } + } + } diff --git a/protocol/unit.go b/protocol/unit.go index 0384c1d..3ed78b0 100644 --- a/protocol/unit.go +++ b/protocol/unit.go @@ -302,7 +302,9 @@ func IsIndex(code string) bool { case code[0:2] == ExchangeSH.String() && code[2:5] == "000": return true case code[0:2] == ExchangeSZ.String() && code[2:5] == "399": + return true case code[0:2] == ExchangeBJ.String() && code[2:5] == "899": + return true } return false }