-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
41 lines (34 loc) · 1.15 KB
/
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
37
38
39
40
41
package main
import (
"sappo/controllers"
"sappo/models"
"github.com/astaxie/beego"
"github.com/astaxie/beego/orm"
)
func init() {
// 注册数据库
models.RegisterDB()
}
func main() {
orm.Debug = true //开启 ORM 调试模式
orm.RunSyncdb("default", false, true) //自动建立新DB表
//注册路由
beego.Router("/", &controllers.HomeController{})
beego.Router("/category", &controllers.CategoryController{})
//采购订单待审批
beego.Router("/daisp", &controllers.DaispController{})
beego.AutoRouter(&controllers.DaispController{})
beego.Router("/sappo", &controllers.SappoController{})
beego.Router("/price", &controllers.PriceController{})
//采购申请待审批
beego.Router("/daisppr", &controllers.DaispprController{})
beego.AutoRouter(&controllers.DaispprController{})
//user
beego.Router("/login", &controllers.LoginController{})
beego.Router("/loginadd", &controllers.LoginaddController{})
beego.Router("/loginchange", &controllers.LoginchangeController{})
beego.ErrorController(&controllers.ErrorController{})
//beego.ErrorHandler("/404", &controllers.PageNotFound{})
//启动beeblog
beego.Run()
}