mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
- 新增 getUSStockPriceInfo 函数用于获取美股实时行情信息 - 修改 SearchStockPriceInfo 函数,支持美股代码查询 - 更新 Tushare 数据接口,增加对美股每日数据的支持 - 优化股票代码处理逻辑,兼容不同市场代码格式
30 lines
588 B
Go
30 lines
588 B
Go
package data
|
|
|
|
import (
|
|
"go-stock/backend/db"
|
|
"testing"
|
|
)
|
|
|
|
// @Author spark
|
|
// @Date 2025/2/17 12:44
|
|
// @Desc
|
|
// -----------------------------------------------------------------------------------
|
|
func TestGetDaily(t *testing.T) {
|
|
db.Init("../../data/stock.db")
|
|
tushareApi := NewTushareApi(getConfig())
|
|
res := tushareApi.GetDaily("00927.HK", "20250101", "20250217", 30)
|
|
t.Log(res)
|
|
|
|
}
|
|
|
|
func TestGetUSDaily(t *testing.T) {
|
|
db.Init("../../data/stock.db")
|
|
tushareApi := NewTushareApi(getConfig())
|
|
|
|
res := tushareApi.GetDaily("gb_AAPL", "20250101", "20250217", 30)
|
|
t.Log(res)
|
|
|
|
//
|
|
|
|
}
|