mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
refactor(app):临时移除屏幕分辨率动态获取
- 注释掉了使用 syscall 动态加载 user32.dll 和 GetSystemMetrics函数的代码 - 固定返回屏幕分辨率为 1366x768 - 解除了 stock_data_api_test.go 中的 db.Init 注释
This commit is contained in:
parent
63a05954f8
commit
c3c770b2ed
13
app.go
13
app.go
@ -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 {
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user