25 lines
505 B
Go
25 lines
505 B
Go
package main
|
|
|
|
import (
|
|
"yintai-api/app/common/utils"
|
|
"yintai-api/app/routers"
|
|
"yintai-api/base/config"
|
|
"yintai-api/base/global"
|
|
)
|
|
|
|
func main() {
|
|
config.LoadConfig()
|
|
global.InitServer("conf/server.conf." + config.GetEnv())
|
|
global.Init()
|
|
routers.InitRouter(global.GetGin())
|
|
global.InitRedis()
|
|
global.InitLog()
|
|
|
|
utils.PermissionInit()
|
|
go utils.AutoIncrementNews()
|
|
|
|
if err := global.GetGin().Run(global.GetConfig().Server.Address); err != nil {
|
|
panic(config.ErrInternal.New().Append(err))
|
|
}
|
|
}
|