| 1234567891011121314151617181920212223242526272829 |
- package internal
- import (
- _ "go.uber.org/automaxprocs"
- "go.uber.org/zap"
- "wails-app/internal/core"
- "wails-app/internal/global"
- "wails-app/internal/initialize"
- )
- // InitBackend initializes the Go backend (Viper, Zap, GORM, Gin) and starts the
- // HTTP server in a background goroutine. It does not block. Call this before
- // running the Wails application.
- func InitBackend() {
- global.GVA_VP = core.Viper()
- initialize.OtherInit()
- global.GVA_LOG = core.Zap()
- zap.ReplaceGlobals(global.GVA_LOG)
- global.GVA_DB = initialize.Gorm()
- initialize.Timer()
- initialize.DBList()
- if global.GVA_DB != nil {
- initialize.RegisterTables()
- initialize.SeedSystemData()
- }
- initialize.InitGateController()
- go core.RunWindowsServer()
- }
|