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 代码相互转换的函数 - 更新相关测试文件以支持新功能
24 lines
375 B
Go
24 lines
375 B
Go
package data
|
|
|
|
import (
|
|
"context"
|
|
"go-stock/backend/db"
|
|
"testing"
|
|
)
|
|
|
|
func TestNewDeepSeekOpenAiConfig(t *testing.T) {
|
|
db.Init("../../data/stock.db")
|
|
ai := NewDeepSeekOpenAi(context.TODO())
|
|
res := ai.NewChatStream("北京文化", "sz000802", "")
|
|
for {
|
|
select {
|
|
case msg := <-res:
|
|
t.Log(msg)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestGetTopNewsList(t *testing.T) {
|
|
GetTopNewsList(30)
|
|
}
|