refactor(app):临时移除屏幕分辨率动态获取

- 注释掉了使用 syscall 动态加载 user32.dll 和 GetSystemMetrics函数的代码
- 固定返回屏幕分辨率为 1366x768
- 解除了 stock_data_api_test.go 中的 db.Init 注释
This commit is contained in:
ArvinLovegood 2025-03-21 20:53:13 +08:00
parent 63a05954f8
commit c3c770b2ed
2 changed files with 7 additions and 8 deletions

13
app.go
View File

@ -24,7 +24,6 @@ import (
"golang.org/x/sys/windows/registry"
"os"
"strings"
"syscall"
"time"
)
@ -739,13 +738,13 @@ func (a *App) ExportConfig() string {
return "导出成功:" + file
}
func getScreenResolution() (int, int, error) {
user32 := syscall.NewLazyDLL("user32.dll")
getSystemMetrics := user32.NewProc("GetSystemMetrics")
//user32 := syscall.NewLazyDLL("user32.dll")
//getSystemMetrics := user32.NewProc("GetSystemMetrics")
//
//width, _, _ := getSystemMetrics.Call(0)
//height, _, _ := getSystemMetrics.Call(1)
width, _, _ := getSystemMetrics.Call(0)
height, _, _ := getSystemMetrics.Call(1)
return int(width), int(height), nil
return int(1366), int(768), nil
}
func (a *App) ShareAnalysis(stockCode, stockName string) string {

View File

@ -46,7 +46,7 @@ func TestSearchStockInfoByCode(t *testing.T) {
}
func TestSearchStockPriceInfo(t *testing.T) {
//db.Init("../../data/stock.db")
db.Init("../../data/stock.db")
//SearchStockPriceInfo("hk06030", 30)
//SearchStockPriceInfo("sh600171", 30)
//SearchStockPriceInfo("gb_aapl", 30)