mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
- 新增 TushareApi 结构体和 GetDaily 方法,用于获取 A 股日线行情数据 - 在 openai_api.go 中添加获取股票日 K线数据的协程 - 在 utils.go 中添加股票代码与 tushare 代码相互转换的函数 - 更新相关测试文件以支持新功能
19 lines
386 B
Go
19 lines
386 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("000802.SZ", "20250101", "20250217")
|
|
t.Log(res)
|
|
|
|
}
|