ituoke/main.go

58 lines
1.6 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package main
import (
"embed"
"log"
"github.com/ituoke/ituoke/internal/agent"
"github.com/ituoke/ituoke/internal/device"
"github.com/wailsapp/wails/v3/pkg/application"
)
//go:embed all:frontend/dist
var assets embed.FS
func main() {
// ============================================================
// [入口] 应用启动:注册服务 → 创建窗口 → 进入事件循环
// 改窗口标题/尺寸/macOS 外观:看下方 Window.NewWithOptions
// 改后端能力:看 Services 列表(DeviceService / AgentService)
// ============================================================
deviceSvc := device.NewService()
agentSvc := agent.NewService()
app := application.New(application.Options{
Name: "iTuoke",
Description: "Enterprise phone control — ADB capture + AI agent",
Services: []application.Service{
// [绑定] 前端可通过 Wails bindings 调用这些 Go 方法
application.NewService(deviceSvc),
application.NewService(agentSvc),
},
Assets: application.AssetOptions{
Handler: application.AssetFileServerFS(assets),
},
Mac: application.MacOptions{
ApplicationShouldTerminateAfterLastWindowClosed: true,
},
})
app.Window.NewWithOptions(application.WebviewWindowOptions{
Title: "iTuoke",
Width: 1440,
Height: 900,
Mac: application.MacWindow{
InvisibleTitleBarHeight: 52,
Backdrop: application.MacBackdropTranslucent,
TitleBar: application.MacTitleBarHiddenInset,
},
BackgroundColour: application.NewRGB(18, 18, 20),
URL: "/",
})
if err := app.Run(); err != nil {
log.Fatal(err)
}
}