-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
36 lines (29 loc) · 836 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main
import (
_ "position/routers"
_ "position/models"
"github.com/astaxie/beego"
_ "github.com/lib/pq"
)
// func init() {
// orm.RegisterDriver("postgres", orm.DRPostgres)
// orm.RegisterDataBase("default", "postgres", "user=zhangyunfeng password='' host=127.0.0.1 port=5432 dbname=beefer sslmode=disable", 30)
// orm.RunSyncdb("default", false, true)
// }
func main() {
// orm.Debug = true
// o := orm.NewOrm()
// o.Using("default")
// u := new(models.User)
// u.Username = "zhangyunfeng"
// u.Age = 25
// u.Summary = "i am running"
// u.Email = "[email protected]"
// u.Auth = 1
// id, err := o.Insert(u)
// fmt.Printf("ID: %d, ERR: %v\n", id, err)
beego.SetLogger("file", `{"filename": "./logs/position.run.log"}`)
beego.BeeLogger.DelLogger("console")
beego.SetLogFuncCall(true)
beego.Run()
}