feat(hk):更新港股数据支持并添加新功能

- 更新 README.md,添加 ETF 和美股支持计划
- 修改 stock.vue,增加弹幕相关图标和功能
- 更新 stock_data_api.go,添加股票价格时间信息
- 修改 stock_data_api_test.go,更新测试用例
This commit is contained in:
ArvinLovegood 2025-02-24 12:15:42 +08:00
parent fbb8b00315
commit 7952c1fceb
4 changed files with 31 additions and 13 deletions

View File

@ -27,9 +27,11 @@
- 欢迎大家提出宝贵的建议欢迎提issue,PR。当然更欢迎[赞助我](#都划到这了如果我的项目对您有帮助请赞助我吧)。💕
## 🧩 功能开发计划
## 🧩 重大功能开发计划
| 功能说明 | 状态 | 备注 |
|-----------------|----|---------------------------------------------------------------------------------------------------------|
|-----------------|----|--------------------------------------------------------------------------------------------------------|
| ETF支持 | 🚧 | ETF数据支持 |
| 美股支持 | 🚧 | 美股数据支持 |
| 港股支持 | ✅ | 港股数据支持 |
| 多轮对话 | ✅ | AI分析后可继续对话提问 |
| 自定义AI分析提问模板 | ✅ | 可配置的提问模板 [v2025.2.12.7-alpha](https://github.com/ArvinLovegood/go-stock/releases/tag/v2025.2.12.7-alpha) |
@ -37,7 +39,7 @@
## 👀 更新日志
### 2025.02.23 弹幕功能,盯盘不再孤单,无聊划个水!😎
### 2025.02.22 港股数据支持
### 2025.02.22 港股数据支持(目前有延迟)
### 2025.02.16 AI分析后可继续对话提问
- [v2025.2.16.1-alpha](https://github.com/ArvinLovegood/go-stock/releases/tag/v2025.2.16.1-alpha)

View File

@ -620,6 +620,7 @@ func getHKStockPriceInfo(stockCode string, crawlTimeOut int64) *[]string {
}
stockName := ""
stockPrice := ""
stockPriceTime := ""
document.Find("#stock_cname").Each(func(i int, selection *goquery.Selection) {
stockName = strutil.RemoveNonPrintable(selection.Text())
logger.SugaredLogger.Infof("股票名称-:%s", stockName)
@ -627,10 +628,16 @@ func getHKStockPriceInfo(stockCode string, crawlTimeOut int64) *[]string {
document.Find("#mts_stock_hk_price").Each(func(i int, selection *goquery.Selection) {
stockPrice = strutil.RemoveNonPrintable(selection.Text())
logger.SugaredLogger.Infof("股票名称-现价: %s", stockPrice)
logger.SugaredLogger.Infof("现价: %s", stockPrice)
})
messages = append(messages, fmt.Sprintf("%s现价%s", stockName, stockPrice))
document.Find("#mts_stock_hk_time").Each(func(i int, selection *goquery.Selection) {
stockPriceTime = strutil.RemoveNonPrintable(selection.Text())
logger.SugaredLogger.Infof("时间: %s", stockPriceTime)
})
messages = append(messages, fmt.Sprintf("%s:%s现价%s", stockPriceTime, stockName, stockPrice))
logger.SugaredLogger.Infof("股票: %s", messages)
document.Find(".deta_hqContainer >.deta03 li").Each(func(i int, selection *goquery.Selection) {
text := strutil.RemoveNonPrintable(selection.Text())

View File

@ -43,7 +43,7 @@ func TestSearchStockInfoByCode(t *testing.T) {
}
func TestSearchStockPriceInfo(t *testing.T) {
SearchStockPriceInfo("hk00927", 30)
SearchStockPriceInfo("hk06030", 30)
//SearchStockPriceInfo("sh600859", 30)
}

View File

@ -30,7 +30,15 @@ import {
useNotification
} from 'naive-ui'
import {EventsEmit, EventsOn, WindowFullscreen, WindowReload, WindowUnfullscreen} from '../../wailsjs/runtime'
import {Add, BalloonOutline} from '@vicons/ionicons5'
import {
Add,
Balloon,
BalloonOutline, ChatboxOutline, ChatbubbleEllipses,
ChatbubbleEllipsesOutline,
ChatbubbleOutline,
Chatbubbles,
ChatbubblesSharp
} from '@vicons/ionicons5'
import {MdPreview,MdEditor } from 'md-editor-v3';
// preview.cssstyle.css
//import 'md-editor-v3/lib/preview.css';
@ -148,6 +156,7 @@ onMounted(() => {
});
// WebSocket
ws.value = new WebSocket('ws://8.134.249.145:16688/ws'); // WebSocket
//ws.value = new WebSocket('ws://localhost:16688/ws'); // WebSocket
ws.value.onopen = () => {
console.log('WebSocket 连接已打开');
@ -797,8 +806,8 @@ AI赋能股票分析自选股行情获取成本盈亏展示涨跌报警
<n-button type="primary" @click="AddStock" v-if="addBTN">
<n-icon :component="Add"/> &nbsp;关注该股票
</n-button>
<n-button type="info" @click="SendDanmu">
<n-icon :component="BalloonOutline"/> &nbsp;发送弹幕
<n-button type="error" @click="SendDanmu">
<n-icon :component="ChatboxOutline"/> &nbsp;发送弹幕
</n-button>
</n-input-group>
<!-- </n-card>-->