mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-05-07 08:43:00 +08:00
- 抽离供应商预设匹配逻辑,避免自定义 OpenAI 端点误识别为千问 Coding Plan - 调整 AI 设置弹窗的预设回填逻辑,并补充预设识别回归测试 - 通过 dev/prod build tag 拆分前端资源装配,避免开发模式依赖 frontend/dist
59 lines
1.5 KiB
Go
59 lines
1.5 KiB
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
|
|
aiservice "GoNavi-Wails/internal/ai/service"
|
|
"GoNavi-Wails/internal/app"
|
|
"GoNavi-Wails/internal/logger"
|
|
|
|
"github.com/wailsapp/wails/v2"
|
|
"github.com/wailsapp/wails/v2/pkg/options"
|
|
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
|
"github.com/wailsapp/wails/v2/pkg/options/mac"
|
|
"github.com/wailsapp/wails/v2/pkg/options/windows"
|
|
)
|
|
|
|
func main() {
|
|
// Create an instance of the app structure
|
|
application := app.NewApp()
|
|
aiService := aiservice.NewService()
|
|
|
|
// Create application with options
|
|
err := wails.Run(&options.App{
|
|
Title: "GoNavi",
|
|
Width: 1024,
|
|
Height: 768,
|
|
Frameless: true,
|
|
AssetServer: &assetserver.Options{
|
|
Assets: assets,
|
|
},
|
|
BackgroundColour: &options.RGBA{R: 0, G: 0, B: 0, A: 0},
|
|
OnStartup: func(ctx context.Context) {
|
|
app.InitializeLifecycle(application, ctx)
|
|
aiservice.InitializeLifecycle(aiService, ctx)
|
|
},
|
|
OnShutdown: application.Shutdown,
|
|
Bind: []interface{}{
|
|
application,
|
|
aiService,
|
|
},
|
|
Windows: &windows.Options{
|
|
WebviewIsTransparent: true,
|
|
WindowIsTranslucent: true,
|
|
BackdropType: windows.Acrylic,
|
|
DisableWindowIcon: false,
|
|
DisableFramelessWindowDecorations: false,
|
|
WebviewUserDataPath: resolveWindowsWebviewUserDataPath(),
|
|
},
|
|
Mac: &mac.Options{
|
|
WebviewIsTransparent: true,
|
|
WindowIsTranslucent: true,
|
|
},
|
|
})
|
|
|
|
if err != nil {
|
|
logger.Error(err, "应用启动失败")
|
|
}
|
|
}
|