diff --git a/backend/data/openai_api_test.go b/backend/data/openai_api_test.go index fe3cfb0..0744467 100644 --- a/backend/data/openai_api_test.go +++ b/backend/data/openai_api_test.go @@ -23,6 +23,7 @@ func TestGetTopNewsList(t *testing.T) { } func TestSearchGuShiTongStockInfo(t *testing.T) { + db.Init("../../data/stock.db") SearchGuShiTongStockInfo("hk01810", 60) SearchGuShiTongStockInfo("sh600745", 60) SearchGuShiTongStockInfo("gb_goog", 60) diff --git a/backend/data/stock_data_api.go b/backend/data/stock_data_api.go index 973f53a..ad0dd61 100644 --- a/backend/data/stock_data_api.go +++ b/backend/data/stock_data_api.go @@ -748,7 +748,14 @@ func GetRealTimeStockPriceInfo(ctx context.Context, stockCode string) (price, pr func SearchStockPriceInfo(stockCode string, crawlTimeOut int64) *[]string { - if strutil.HasPrefixAny(stockCode, []string{"SZ", "SH", "sh", "sz"}) { + if strutil.HasPrefixAny(stockCode, []string{"SZ", "SH", "sh", "sz", "bj"}) { + if strutil.HasPrefixAny(stockCode, []string{"bj", "BJ"}) { + stockCode = strutil.ReplaceWithMap(stockCode, map[string]string{ + "bj": "", + "BJ": "", + }) + ".BJ" + } + return getSHSZStockPriceInfo(stockCode, crawlTimeOut) } if strutil.HasPrefixAny(stockCode, []string{"HK", "hk"}) { diff --git a/backend/data/stock_data_api_test.go b/backend/data/stock_data_api_test.go index a0e2f97..ae2ca55 100644 --- a/backend/data/stock_data_api_test.go +++ b/backend/data/stock_data_api_test.go @@ -46,9 +46,11 @@ func TestSearchStockInfoByCode(t *testing.T) { } func TestSearchStockPriceInfo(t *testing.T) { + db.Init("../../data/stock.db") //SearchStockPriceInfo("hk06030", 30) //SearchStockPriceInfo("sh600171", 30) - SearchStockPriceInfo("gb_aapl", 30) + //SearchStockPriceInfo("gb_aapl", 30) + SearchStockPriceInfo("bj430198", 30) } diff --git a/frontend/src/components/fund.vue b/frontend/src/components/fund.vue index 2dc1170..70888c0 100644 --- a/frontend/src/components/fund.vue +++ b/frontend/src/components/fund.vue @@ -183,7 +183,7 @@ function blinkBorder(findId){ - +