forked from destory97/LanBlog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrouter.go
42 lines (38 loc) · 885 Bytes
/
router.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
42
// @APIVersion 1.0.0
// @Title beego Test API
// @Description beego has a very cool tools to autogenerate documents for your API
// @Contact [email protected]
// @TermsOfServiceUrl http://beego.me/
// @License Apache 2.0
// @LicenseUrl http://www.apache.org/licenses/LICENSE-2.0.html
package routers
import (
"MyBlog/controllers"
"github.com/astaxie/beego"
)
func init() {
ns := beego.NewNamespace("/v1",
beego.NSNamespace("/topic",
beego.NSInclude(
&controllers.TopicController{},
),
),
beego.NSNamespace("/category",
beego.NSInclude(
&controllers.CategoryController{},
),
),
beego.NSNamespace("/label",
beego.NSInclude(
&controllers.LabelController{},
),
),
beego.NSNamespace("/admin",
beego.NSInclude(
&controllers.AdminController{},
),
),
)
beego.AddNamespace(ns)
beego.Router("/", &controllers.HomeController{})
}