Browse Source

修改api路径

layui
yirenyishi 6 years ago
parent
commit
fb229a80ca
  1. 6
      routers/BlogRouter.go
  2. 4
      routers/CommentRouter.go
  3. 4
      routers/LikeRouter.go
  4. 14
      routers/NoteRouter.go
  5. 2
      routers/UserRouter.go

6
routers/BlogRouter.go

@ -6,11 +6,11 @@ import (
) )
func init() { func init() {
beego.Router("/blog/new", &controllers.BlogController{}, "post:Save") beego.Router("/api/blog/new", &controllers.BlogController{}, "post:Save")
beego.Router("/blog/edit", &controllers.BlogController{}, "post:Edit") beego.Router("/api/blog/edit", &controllers.BlogController{}, "post:Edit")
beego.Router("/api/blog/del/:id([0-9]+)", &controllers.BlogController{}, "post:Del")
beego.Router("/blog/edit/:id([0-9]+)", &controllers.BlogController{}, "get:EditPage") beego.Router("/blog/edit/:id([0-9]+)", &controllers.BlogController{}, "get:EditPage")
beego.Router("/blog/:id([0-9]+)", &controllers.BlogController{}, "get:Get") beego.Router("/blog/:id([0-9]+)", &controllers.BlogController{}, "get:Get")
beego.Router("/blog/del/:id([0-9]+)", &controllers.BlogController{}, "post:Del")
beego.Router("/blogs", &controllers.BlogController{}, "get:BlogsPage") beego.Router("/blogs", &controllers.BlogController{}, "get:BlogsPage")
beego.Router("/blog/new", &controllers.BlogController{}, "get:New") beego.Router("/blog/new", &controllers.BlogController{}, "get:New")
} }

4
routers/CommentRouter.go

@ -6,6 +6,6 @@ import (
) )
func init() { func init() {
beego.Router("/comms/save", &controllers.CommentController{}, "post:Save") beego.Router("/api/comms/save", &controllers.CommentController{}, "post:Save")
beego.Router("/comms/del/:id([0-9]+)", &controllers.CommentController{}, "get:Del") beego.Router("/api/comms/del/:id([0-9]+)", &controllers.CommentController{}, "get:Del")
} }

4
routers/LikeRouter.go

@ -6,6 +6,6 @@ import (
) )
func init() { func init() {
beego.Router("/like/:id([0-9]+)", &controllers.LikeController{}, "get:Save") beego.Router("/api/like/:id([0-9]+)", &controllers.LikeController{}, "get:Save")
beego.Router("/unlike/:id([0-9]+)", &controllers.LikeController{}, "get:Delete") beego.Router("/api/unlike/:id([0-9]+)", &controllers.LikeController{}, "get:Delete")
} }

14
routers/NoteRouter.go

@ -6,12 +6,12 @@ import (
) )
func init() { func init() {
beego.Router("/note/:id([0-9]+)", &controllers.NoteController{}, "get:Get") beego.Router("/api/note/:id([0-9]+)", &controllers.NoteController{}, "get:Get")
beego.Router("/note", &controllers.NoteController{}, "get:Note") beego.Router("/note", &controllers.NoteController{}, "get:Note")
beego.Router("/notecoll/save", &controllers.NoteController{}, "post:SaveNoteColl") beego.Router("/api/notecoll/save", &controllers.NoteController{}, "post:SaveNoteColl")
beego.Router("/notecoll/edit", &controllers.NoteController{}, "post:EditNoteColl") beego.Router("/api/notecoll/edit", &controllers.NoteController{}, "post:EditNoteColl")
beego.Router("/note/save", &controllers.NoteController{}, "post:Save") beego.Router("/api/api/note/save", &controllers.NoteController{}, "post:Save")
beego.Router("/note/edit/:id([0-9]+)", &controllers.NoteController{}, "post:Edit") beego.Router("/api/note/edit/:id([0-9]+)", &controllers.NoteController{}, "post:Edit")
beego.Router("/note/del/:id([0-9]+)", &controllers.NoteController{}, "post:Delete") beego.Router("/api/note/del/:id([0-9]+)", &controllers.NoteController{}, "post:Delete")
beego.Router("/notecol/del/:id([0-9]+)", &controllers.NoteController{}, "post:DelNoteColl") beego.Router("/api/notecol/del/:id([0-9]+)", &controllers.NoteController{}, "post:DelNoteColl")
} }

2
routers/UserRouter.go

@ -11,7 +11,7 @@ func init() {
beego.Router("/login", &controllers.UserController{}, "post:Login") beego.Router("/login", &controllers.UserController{}, "post:Login")
beego.Router("/regist", &controllers.UserController{}, "post:Regist") beego.Router("/regist", &controllers.UserController{}, "post:Regist")
beego.Router("/regist", &controllers.UserController{}, "get:RegistPage") beego.Router("/regist", &controllers.UserController{}, "get:RegistPage")
beego.Router("/user/edit", &controllers.UserController{}, "post:Edit") beego.Router("/api/user/edit", &controllers.UserController{}, "post:Edit")
beego.Router("/u/:id([0-9]+)", &controllers.UserController{}, "get:UserInfo") beego.Router("/u/:id([0-9]+)", &controllers.UserController{}, "get:UserInfo")

Loading…
Cancel
Save