mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
- 新增 GetKLineData 方法,用于获取指定股票的 K线数据 - 实现了将 JSON 数据转换为 Markdown 表格的函数 JSONToMarkdownTable- 在 NewChatStream 中添加了对 A 股 K线数据的获取和展示逻辑- 增加了相关测试用例
32 lines
619 B
Go
32 lines
619 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("长电科技", "sh600584", "长电科技分析和总结", nil)
|
|
for {
|
|
select {
|
|
case msg := <-res:
|
|
t.Log(msg)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestGetTopNewsList(t *testing.T) {
|
|
GetTopNewsList(30)
|
|
}
|
|
|
|
func TestSearchGuShiTongStockInfo(t *testing.T) {
|
|
//db.Init("../../data/stock.db")
|
|
SearchGuShiTongStockInfo("hk01810", 60)
|
|
SearchGuShiTongStockInfo("sh600745", 60)
|
|
SearchGuShiTongStockInfo("gb_goog", 60)
|
|
|
|
}
|