v2版本正式上线测试版

This commit is contained in:
george
2018-07-13 17:53:34 +08:00
parent 092ecf605b
commit 7bbe5585d8
661 changed files with 40153 additions and 2053 deletions

View File

@@ -10,10 +10,11 @@ package models
import (
"net/url"
"fmt"
"github.com/astaxie/beego"
"github.com/astaxie/beego/orm"
_ "github.com/go-sql-driver/mysql"
"github.com/gpmgo/gopm/modules/log"
)
func Init() {
@@ -27,13 +28,23 @@ func Init() {
dbport = "3306"
}
dsn := dbuser + ":" + dbpassword + "@tcp(" + dbhost + ":" + dbport + ")/" + dbname + "?charset=utf8"
log.Fatal(dsn)
fmt.Println(dsn)
if timezone != "" {
dsn = dsn + "&loc=" + url.QueryEscape(timezone)
}
orm.RegisterDataBase("default", "mysql", dsn)
orm.RegisterModel(new(User), new(Task), new(TaskGroup), new(TaskLog), new(TaskServer))
orm.RegisterModel(
new(Admin),
new(Auth),
new(Role),
new(RoleAuth),
new(ServerGroup),
new(TaskServer),
new(Ban),
new(Group),
new(Task),
new(TaskLog),
)
if beego.AppConfig.String("runmode") == "dev" {
orm.Debug = true