增加了获取股票数量的接口

This commit is contained in:
injoyai
2024-10-28 17:03:33 +08:00
parent fc478d7d85
commit 791bd4bfac
8 changed files with 75 additions and 6 deletions

View File

@@ -0,0 +1,19 @@
package main
import (
"github.com/injoyai/logs"
"github.com/injoyai/tdx"
"github.com/injoyai/tdx/protocol"
)
func main() {
c, err := tdx.Dial("124.71.187.122:7709")
logs.PanicErr(err)
resp, err := c.GetStockCount(protocol.ExchangeSH)
logs.PanicErr(err)
logs.Debug(resp.Count)
<-c.Done()
}

View File

@@ -10,12 +10,13 @@ func main() {
c, err := tdx.Dial("124.71.187.122:7709")
logs.PanicErr(err)
resp, err := c.GetStockList(protocol.ExchangeSH)
logs.PrintErr(err)
resp, err := c.GetStockList(protocol.ExchangeSH, 200)
logs.PanicErr(err)
for _, v := range resp.List {
logs.Debug(v)
}
logs.Debug("总数:", resp.Count)
select {}
}

View File

@@ -11,7 +11,7 @@ func main() {
logs.PanicErr(err)
resp, err := c.GetStockMinute(protocol.ExchangeSZ, "000001")
logs.PrintErr(err)
logs.PanicErr(err)
for _, v := range resp.List {
logs.Debug(v)

View File

@@ -25,7 +25,7 @@ func main() {
protocol.ExchangeSH: "000001",
protocol.ExchangeSZ: "600008",
})
logs.PrintErr(err)
logs.PanicErr(err)
for _, v := range resp {
logs.Debugf("%#v\n", v)