mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
- 更新 SearchStockPriceInfo 函数签名,增加 stockName 参数 - 优化股票价格信息的爬取逻辑,支持不同市场类型的股票 - 调整输出格式,增加股票名称和时间信息 - 添加日志记录,方便调试和监控
32 lines
618 B
Go
32 lines
618 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("中信证券", "hk06030", "中信证券分析和总结", 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)
|
|
|
|
}
|