Try to abstract the core package.

This commit is contained in:
zicla
2019-04-27 23:25:46 +08:00
parent 2732b14eae
commit 02805363ac
6 changed files with 28 additions and 28 deletions

View File

@ -3,9 +3,9 @@ package main
import (
"fmt"
"github.com/eyebluecn/tank/code/config"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/rest"
"github.com/eyebluecn/tank/code/support"
"github.com/eyebluecn/tank/code/tool/inter"
_ "github.com/go-sql-driver/mysql"
"log"
"net/http"
@ -17,7 +17,7 @@ func main() {
tankLogger := &support.TankLogger{}
tankLogger.Init()
defer tankLogger.Destroy()
inter.LOGGER = tankLogger
core.LOGGER = tankLogger
//装载配置文件,这个决定了是否需要执行安装过程
config.CONFIG.Init()
@ -28,7 +28,7 @@ func main() {
http.Handle("/", rest.CONTEXT.Router)
inter.LOGGER.Info("App started at http://localhost:%v", config.CONFIG.ServerPort)
core.LOGGER.Info("App started at http://localhost:%v", config.CONFIG.ServerPort)
dotPort := fmt.Sprintf(":%v", config.CONFIG.ServerPort)
err1 := http.ListenAndServe(dotPort, nil)