mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
- 在 App.vue 中添加个股资金流向相关路由和菜单项 - 新增 RankTable 组件用于展示排名数据 - 在 market.vue 中集成 RankTable 组件,实现资金流向排名展示 - 在后端添加 GetIndustryMoneyRankSina 和 GetMoneyRankSina接口 - 更新前端 App.d.ts、App.js 和后端 app.go 以支持新功能
52 lines
1.2 KiB
Go
52 lines
1.2 KiB
Go
package data
|
|
|
|
import (
|
|
"encoding/json"
|
|
"go-stock/backend/db"
|
|
"go-stock/backend/logger"
|
|
"testing"
|
|
)
|
|
|
|
// @Author spark
|
|
// @Date 2025/4/23 17:58
|
|
// @Desc
|
|
//-----------------------------------------------------------------------------------
|
|
|
|
func TestGetSinaNews(t *testing.T) {
|
|
db.Init("../../data/stock.db")
|
|
NewMarketNewsApi().GetSinaNews(30)
|
|
//NewMarketNewsApi().GetNewTelegraph(30)
|
|
|
|
}
|
|
|
|
func TestGlobalStockIndexes(t *testing.T) {
|
|
resp := NewMarketNewsApi().GlobalStockIndexes(30)
|
|
bytes, err := json.Marshal(resp)
|
|
if err != nil {
|
|
return
|
|
}
|
|
logger.SugaredLogger.Debugf("resp: %+v", string(bytes))
|
|
}
|
|
|
|
func TestGetIndustryRank(t *testing.T) {
|
|
res := NewMarketNewsApi().GetIndustryRank("0", 10)
|
|
for s, a := range res["data"].([]any) {
|
|
logger.SugaredLogger.Debugf("key: %+v, value: %+v", s, a)
|
|
|
|
}
|
|
}
|
|
func TestGetIndustryMoneyRankSina(t *testing.T) {
|
|
res := NewMarketNewsApi().GetIndustryMoneyRankSina("2")
|
|
for i, re := range res {
|
|
logger.SugaredLogger.Debugf("key: %+v, value: %+v", i, re)
|
|
|
|
}
|
|
}
|
|
func TestGetMoneyRankSina(t *testing.T) {
|
|
res := NewMarketNewsApi().GetMoneyRankSina("r3_net")
|
|
for i, re := range res {
|
|
logger.SugaredLogger.Debugf("key: %+v, value: %+v", i, re)
|
|
|
|
}
|
|
}
|