diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 145c990..67ffd8a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,9 +4,9 @@ on: push: branches: - master - tags: - # Match any new tag - - '*-release' +# tags: +# # Match any new tag +# - '*-release' env: # Necessary for most environments as build failure can occur due to OOM issues diff --git a/app_common.go b/app_common.go index c557435..d3a652a 100644 --- a/app_common.go +++ b/app_common.go @@ -17,3 +17,6 @@ func (a *App) LongTigerRank(date string) *[]models.LongTigerRankData { func (a *App) StockResearchReport(stockCode string) []any { return data.NewMarketNewsApi().StockResearchReport(stockCode, 7) } +func (a *App) StockNotice(stockCode string) []any { + return data.NewMarketNewsApi().StockNotice(stockCode) +} diff --git a/backend/data/market_news_api.go b/backend/data/market_news_api.go index b90fd6f..f6d3c49 100644 --- a/backend/data/market_news_api.go +++ b/backend/data/market_news_api.go @@ -433,3 +433,28 @@ func (m MarketNewsApi) StockResearchReport(stockCode string, days int) []any { //logger.SugaredLogger.Infof("resp:%+v", respMap["data"]) return respMap["data"].([]any) } + +func (m MarketNewsApi) StockNotice(stock_list string) []any { + var stockCodes []string + for _, stockCode := range strings.Split(stock_list, ",") { + if strutil.ContainsAny(stockCode, []string{"."}) { + stockCode = strings.Split(stockCode, ".")[0] + stockCodes = append(stockCodes, stockCode) + } + } + + url := "https://np-anotice-stock.eastmoney.com/api/security/ann?page_size=50&page_index=1&ann_type=SHA%2CCYB%2CSZA%2CBJA%2CINV&client_source=web&f_node=0&stock_list=" + strings.Join(stockCodes, ",") + resp, err := resty.New().SetTimeout(time.Duration(15)*time.Second).R(). + SetHeader("Host", "np-anotice-stock.eastmoney.com"). + SetHeader("Referer", "https://data.eastmoney.com/notices/hsa/5.html"). + SetHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0"). + Get(url) + respMap := map[string]any{} + + if err != nil { + return []any{} + } + json.Unmarshal(resp.Body(), &respMap) + //logger.SugaredLogger.Infof("resp:%+v", respMap["data"]) + return (respMap["data"].(map[string]any))["list"].([]any) +} diff --git a/backend/data/market_news_api_test.go b/backend/data/market_news_api_test.go index 032aa6e..5513961 100644 --- a/backend/data/market_news_api_test.go +++ b/backend/data/market_news_api_test.go @@ -72,3 +72,12 @@ func TestStockResearchReport(t *testing.T) { logger.SugaredLogger.Debugf("value: %+v", a) } } + +func TestStockNotice(t *testing.T) { + db.Init("../../data/stock.db") + resp := NewMarketNewsApi().StockNotice("600584,600900") + for _, a := range resp { + logger.SugaredLogger.Debugf("value: %+v", a) + } + +} diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 61b501f..760e45c 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -261,6 +261,27 @@ const menuOptions = ref([ key: 'market7', icon: renderIcon(NewspaperSharp), }, + { + label: () => + h( + RouterLink, + { + href: '#', + to: { + name: 'market', + query: { + name: "公司公告", + } + }, + onClick: () => { + EventsEmit("changeMarketTab", {ID: 0, name: '公司公告'}) + }, + }, + {default: () => '公司公告',} + ), + key: 'market8', + icon: renderIcon(NewspaperSharp), + }, ] }, { diff --git a/frontend/src/components/KLineChart.vue b/frontend/src/components/KLineChart.vue index ae2ab30..5791430 100644 --- a/frontend/src/components/KLineChart.vue +++ b/frontend/src/components/KLineChart.vue @@ -356,7 +356,7 @@ function handleKLine(code,name){ chart.setOption(option); chart.on('click',{seriesName:'日K'}, function(params) { - console.log("click:",params); + //console.log("click:",params); }); }) } diff --git a/frontend/src/components/StockNoticeList.vue b/frontend/src/components/StockNoticeList.vue new file mode 100644 index 0000000..f99fc31 --- /dev/null +++ b/frontend/src/components/StockNoticeList.vue @@ -0,0 +1,114 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/StockResearchReportList.vue b/frontend/src/components/StockResearchReportList.vue index 2365483..fa719b5 100644 --- a/frontend/src/components/StockResearchReportList.vue +++ b/frontend/src/components/StockResearchReportList.vue @@ -15,7 +15,7 @@ const options = ref([]) function getStockResearchReport(value) { StockResearchReport(value).then(result => { - console.log(result) + //console.log(result) list.value = result }) } @@ -97,7 +97,7 @@ function handleSearch(value) { - +