From d839bf5bb7fbc6e44c964f760d9a238f0eeb8b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E7=BA=AF=E5=87=80?= <1113655791@qq.com> Date: Tue, 5 Nov 2024 00:32:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 478e8aa..b768af5 100644 --- a/README.md +++ b/README.md @@ -28,29 +28,25 @@ package main import ( - "fmt" - "github.com/injoyai/tdx" - "github.com/injoyai/tdx/protocol" + "fmt" + "github.com/injoyai/tdx" ) func main() { - //连接服务器,开启日志,开启断连重试 - c, err := tdx.Dial("124.71.187.122:7709", tdx.WithDebug(true), tdx.WithRedial(true)) - if err != nil { - panic(err) - } - resp, err := c.GetStockQuotes(map[protocol.Exchange]string{ - protocol.ExchangeSZ: "000001", - protocol.ExchangeSH: "600008", - }) - if err != nil { - panic(err) - } + //连接服务器,开启日志,开启断连重试 + c, err := tdx.Dial("124.71.187.122:7709", tdx.WithDebug(), tdx.WithRedial()) + if err != nil { + panic(err) + } + resp, err := c.GetQuote("sz000001", "sh600008") + if err != nil { + panic(err) + } - for _, v := range resp { - fmt.Printf("%#v\n", v) - } - <-c.Done() + for _, v := range resp { + fmt.Printf("%#v\n", v) + } + <-c.Done() } ```