mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
29 lines
630 B
Go
29 lines
630 B
Go
package main
|
|
|
|
import (
|
|
"pandax/apps/job/jobs"
|
|
"pandax/base/config"
|
|
"pandax/base/ctx"
|
|
"pandax/base/global"
|
|
"pandax/base/starter"
|
|
"pandax/initialize"
|
|
"pandax/middleware"
|
|
)
|
|
|
|
func main() {
|
|
global.Db = starter.GormInit(config.Conf.Server.DbType)
|
|
initialize.InitTable()
|
|
// gin后置 函数
|
|
ctx.UseAfterHandlerInterceptor(middleware.OperationHandler)
|
|
// gin前置 函数
|
|
ctx.UseBeforeHandlerInterceptor(ctx.PermissionHandler)
|
|
// gin后置 函数
|
|
ctx.UseAfterHandlerInterceptor(ctx.LogHandler)
|
|
go func() {
|
|
// 启动系统调度任务
|
|
jobs.InitJob()
|
|
jobs.Setup()
|
|
}()
|
|
starter.RunWebServer(initialize.InitRouter())
|
|
}
|