main.go 508 字节
package main

import (
	"oppmg/common"
	_ "oppmg/routers"
	"time"

	"oppmg/common/config"
	"oppmg/common/log"

	"github.com/astaxie/beego"
	"github.com/astaxie/beego/orm"
	_ "github.com/go-sql-driver/mysql"
)

func init() {
	beego.BConfig.WebConfig.Session.SessionOn = true
	common.ResetCommonConfig()
	log.Debug("加载配置%s", config.MConfig.ConfigName)
	orm.RegisterDataBase("default", "mysql", config.MConfig.SqlConn)
}

func main() {

	log.Debug("%s 应用启动", time.Now().String())
	beego.Run()
}