2017-04-19 18:19:27 +08:00
|
|
|
package routers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/astaxie/beego"
|
2021-03-23 15:09:17 +08:00
|
|
|
"github.com/mindoc-org/mindoc/controllers"
|
2017-04-19 18:19:27 +08:00
|
|
|
)
|
|
|
|
|
2017-12-20 16:16:41 +08:00
|
|
|
func init() {
|
|
|
|
beego.Router("/", &controllers.HomeController{}, "*:Index")
|
|
|
|
|
|
|
|
beego.Router("/login", &controllers.AccountController{}, "*:Login")
|
2021-03-19 10:33:59 +08:00
|
|
|
beego.Router("/dingtalk_login", &controllers.AccountController{}, "*:DingTalkLogin")
|
2017-12-20 16:16:41 +08:00
|
|
|
beego.Router("/logout", &controllers.AccountController{}, "*:Logout")
|
|
|
|
beego.Router("/register", &controllers.AccountController{}, "*:Register")
|
|
|
|
beego.Router("/find_password", &controllers.AccountController{}, "*:FindPassword")
|
|
|
|
beego.Router("/valid_email", &controllers.AccountController{}, "post:ValidEmail")
|
|
|
|
beego.Router("/captcha", &controllers.AccountController{}, "*:Captcha")
|
|
|
|
|
|
|
|
beego.Router("/manager", &controllers.ManagerController{}, "*:Index")
|
|
|
|
beego.Router("/manager/users", &controllers.ManagerController{}, "*:Users")
|
|
|
|
beego.Router("/manager/users/edit/:id", &controllers.ManagerController{}, "*:EditMember")
|
|
|
|
beego.Router("/manager/member/create", &controllers.ManagerController{}, "post:CreateMember")
|
|
|
|
beego.Router("/manager/member/delete", &controllers.ManagerController{}, "post:DeleteMember")
|
|
|
|
beego.Router("/manager/member/update-member-status", &controllers.ManagerController{}, "post:UpdateMemberStatus")
|
|
|
|
beego.Router("/manager/member/change-member-role", &controllers.ManagerController{}, "post:ChangeMemberRole")
|
|
|
|
beego.Router("/manager/books", &controllers.ManagerController{}, "*:Books")
|
|
|
|
beego.Router("/manager/books/edit/:key", &controllers.ManagerController{}, "*:EditBook")
|
|
|
|
beego.Router("/manager/books/delete", &controllers.ManagerController{}, "*:DeleteBook")
|
2018-07-10 18:53:41 +08:00
|
|
|
|
2017-12-20 16:16:41 +08:00
|
|
|
beego.Router("/manager/comments", &controllers.ManagerController{}, "*:Comments")
|
|
|
|
beego.Router("/manager/setting", &controllers.ManagerController{}, "*:Setting")
|
2018-07-10 18:53:41 +08:00
|
|
|
beego.Router("/manager/books/token", &controllers.ManagerController{}, "post:CreateToken")
|
2017-12-20 16:16:41 +08:00
|
|
|
beego.Router("/manager/books/transfer", &controllers.ManagerController{}, "post:Transfer")
|
|
|
|
beego.Router("/manager/books/open", &controllers.ManagerController{}, "post:PrivatelyOwned")
|
2018-07-10 18:53:41 +08:00
|
|
|
|
2017-12-20 16:16:41 +08:00
|
|
|
beego.Router("/manager/attach/list", &controllers.ManagerController{}, "*:AttachList")
|
|
|
|
beego.Router("/manager/attach/detailed/:id", &controllers.ManagerController{}, "*:AttachDetailed")
|
|
|
|
beego.Router("/manager/attach/delete", &controllers.ManagerController{}, "post:AttachDelete")
|
2021-03-23 15:09:17 +08:00
|
|
|
beego.Router("/manager/label/list", &controllers.ManagerController{}, "get:LabelList")
|
|
|
|
beego.Router("/manager/label/delete/:id", &controllers.ManagerController{}, "post:LabelDelete")
|
2017-12-20 16:16:41 +08:00
|
|
|
|
2018-11-15 17:48:41 +08:00
|
|
|
//beego.Router("/manager/config", &controllers.ManagerController{}, "*:Config")
|
2018-09-19 11:32:29 +08:00
|
|
|
|
2018-11-05 18:50:01 +08:00
|
|
|
beego.Router("/manager/team", &controllers.ManagerController{}, "*:Team")
|
|
|
|
beego.Router("/manager/team/create", &controllers.ManagerController{}, "POST:TeamCreate")
|
|
|
|
beego.Router("/manager/team/edit", &controllers.ManagerController{}, "POST:TeamEdit")
|
|
|
|
beego.Router("/manager/team/delete", &controllers.ManagerController{}, "POST:TeamDelete")
|
|
|
|
|
|
|
|
beego.Router("/manager/team/member/list/:id", &controllers.ManagerController{}, "*:TeamMemberList")
|
|
|
|
beego.Router("/manager/team/member/add", &controllers.ManagerController{}, "POST:TeamMemberAdd")
|
|
|
|
beego.Router("/manager/team/member/delete", &controllers.ManagerController{}, "POST:TeamMemberDelete")
|
|
|
|
beego.Router("/manager/team/member/change_role", &controllers.ManagerController{}, "POST:TeamChangeMemberRole")
|
|
|
|
beego.Router("/manager/team/member/search", &controllers.ManagerController{}, "*:TeamSearchMember")
|
|
|
|
|
|
|
|
beego.Router("/manager/team/book/list/:id", &controllers.ManagerController{}, "*:TeamBookList")
|
|
|
|
beego.Router("/manager/team/book/add", &controllers.ManagerController{}, "POST:TeamBookAdd")
|
|
|
|
beego.Router("/manager/team/book/delete", &controllers.ManagerController{}, "POST:TeamBookDelete")
|
2018-11-06 18:38:18 +08:00
|
|
|
beego.Router("/manager/team/book/search", &controllers.ManagerController{}, "*:TeamSearchBook")
|
2018-11-05 18:50:01 +08:00
|
|
|
|
2021-03-23 15:09:17 +08:00
|
|
|
beego.Router("/manager/itemsets", &controllers.ManagerController{}, "*:Itemsets")
|
|
|
|
beego.Router("/manager/itemsets/edit", &controllers.ManagerController{}, "post:ItemsetsEdit")
|
|
|
|
beego.Router("/manager/itemsets/delete", &controllers.ManagerController{}, "post:ItemsetsDelete")
|
2018-11-05 18:50:01 +08:00
|
|
|
|
2017-12-20 16:16:41 +08:00
|
|
|
beego.Router("/setting", &controllers.SettingController{}, "*:Index")
|
|
|
|
beego.Router("/setting/password", &controllers.SettingController{}, "*:Password")
|
|
|
|
beego.Router("/setting/upload", &controllers.SettingController{}, "*:Upload")
|
|
|
|
|
|
|
|
beego.Router("/book", &controllers.BookController{}, "*:Index")
|
|
|
|
beego.Router("/book/:key/dashboard", &controllers.BookController{}, "*:Dashboard")
|
|
|
|
beego.Router("/book/:key/setting", &controllers.BookController{}, "*:Setting")
|
|
|
|
beego.Router("/book/:key/users", &controllers.BookController{}, "*:Users")
|
|
|
|
beego.Router("/book/:key/release", &controllers.BookController{}, "post:Release")
|
|
|
|
beego.Router("/book/:key/sort", &controllers.BookController{}, "post:SaveSort")
|
2018-11-06 18:38:18 +08:00
|
|
|
beego.Router("/book/:key/teams", &controllers.BookController{}, "*:Team")
|
|
|
|
|
2017-12-20 16:16:41 +08:00
|
|
|
beego.Router("/book/create", &controllers.BookController{}, "*:Create")
|
2018-11-20 20:36:14 +08:00
|
|
|
beego.Router("/book/itemsets/search", &controllers.BookController{}, "*:ItemsetsSearch")
|
|
|
|
|
2017-12-20 16:16:41 +08:00
|
|
|
beego.Router("/book/users/create", &controllers.BookMemberController{}, "post:AddMember")
|
|
|
|
beego.Router("/book/users/change", &controllers.BookMemberController{}, "post:ChangeRole")
|
|
|
|
beego.Router("/book/users/delete", &controllers.BookMemberController{}, "post:RemoveMember")
|
2021-03-23 15:09:17 +08:00
|
|
|
beego.Router("/book/users/import", &controllers.BookController{}, "post:Import")
|
|
|
|
beego.Router("/book/users/copy", &controllers.BookController{}, "post:Copy")
|
2017-12-20 16:16:41 +08:00
|
|
|
|
|
|
|
beego.Router("/book/setting/save", &controllers.BookController{}, "post:SaveBook")
|
|
|
|
beego.Router("/book/setting/open", &controllers.BookController{}, "post:PrivatelyOwned")
|
|
|
|
beego.Router("/book/setting/transfer", &controllers.BookController{}, "post:Transfer")
|
|
|
|
beego.Router("/book/setting/upload", &controllers.BookController{}, "post:UploadCover")
|
|
|
|
beego.Router("/book/setting/delete", &controllers.BookController{}, "post:Delete")
|
|
|
|
|
2018-11-06 18:38:18 +08:00
|
|
|
beego.Router("/book/team/add", &controllers.BookController{}, "POST:TeamAdd")
|
|
|
|
beego.Router("/book/team/delete", &controllers.BookController{}, "POST:TeamDelete")
|
2018-11-08 20:08:30 +08:00
|
|
|
beego.Router("/book/team/search", &controllers.BookController{}, "*:TeamSearch")
|
2018-11-06 18:38:18 +08:00
|
|
|
|
2018-07-13 19:04:51 +08:00
|
|
|
//管理文章的路由
|
2021-03-23 15:09:17 +08:00
|
|
|
beego.Router("/manage/blogs", &controllers.BlogController{}, "*:ManageList")
|
2018-07-23 18:37:02 +08:00
|
|
|
beego.Router("/manage/blogs/setting/?:id", &controllers.BlogController{}, "*:ManageSetting")
|
2021-03-23 15:09:17 +08:00
|
|
|
beego.Router("/manage/blogs/edit/?:id", &controllers.BlogController{}, "*:ManageEdit")
|
|
|
|
beego.Router("/manage/blogs/delete", &controllers.BlogController{}, "post:ManageDelete")
|
|
|
|
beego.Router("/manage/blogs/upload", &controllers.BlogController{}, "post:Upload")
|
|
|
|
beego.Router("/manage/blogs/attach/:id", &controllers.BlogController{}, "post:RemoveAttachment")
|
2018-07-13 19:04:51 +08:00
|
|
|
|
|
|
|
//读文章的路由
|
2018-07-23 18:37:02 +08:00
|
|
|
beego.Router("/blogs", &controllers.BlogController{}, "*:List")
|
2021-03-23 15:09:17 +08:00
|
|
|
beego.Router("/blog-attach/:id:int/:attach_id:int", &controllers.BlogController{}, "get:Download")
|
|
|
|
beego.Router("/blog-:id([0-9]+).html", &controllers.BlogController{}, "*:Index")
|
2018-07-13 19:04:51 +08:00
|
|
|
|
2018-08-13 19:05:49 +08:00
|
|
|
//模板相关接口
|
2021-03-23 15:09:17 +08:00
|
|
|
beego.Router("/api/template/get", &controllers.TemplateController{}, "get:Get")
|
|
|
|
beego.Router("/api/template/list", &controllers.TemplateController{}, "post:List")
|
|
|
|
beego.Router("/api/template/add", &controllers.TemplateController{}, "post:Add")
|
|
|
|
beego.Router("/api/template/remove", &controllers.TemplateController{}, "post:Delete")
|
2018-08-13 19:05:49 +08:00
|
|
|
|
2017-12-20 16:16:41 +08:00
|
|
|
beego.Router("/api/attach/remove/", &controllers.DocumentController{}, "post:RemoveAttachment")
|
|
|
|
beego.Router("/api/:key/edit/?:id", &controllers.DocumentController{}, "*:Edit")
|
|
|
|
beego.Router("/api/upload", &controllers.DocumentController{}, "post:Upload")
|
|
|
|
beego.Router("/api/:key/create", &controllers.DocumentController{}, "post:Create")
|
|
|
|
beego.Router("/api/:key/delete", &controllers.DocumentController{}, "post:Delete")
|
|
|
|
beego.Router("/api/:key/content/?:id", &controllers.DocumentController{}, "*:Content")
|
|
|
|
beego.Router("/api/:key/compare/:id", &controllers.DocumentController{}, "*:Compare")
|
2018-02-03 15:25:10 +08:00
|
|
|
beego.Router("/api/search/user/:key", &controllers.SearchController{}, "*:User")
|
2017-12-20 16:16:41 +08:00
|
|
|
|
|
|
|
beego.Router("/history/get", &controllers.DocumentController{}, "get:History")
|
|
|
|
beego.Router("/history/delete", &controllers.DocumentController{}, "*:DeleteHistory")
|
|
|
|
beego.Router("/history/restore", &controllers.DocumentController{}, "*:RestoreHistory")
|
|
|
|
|
|
|
|
beego.Router("/docs/:key", &controllers.DocumentController{}, "*:Index")
|
|
|
|
beego.Router("/docs/:key/:id", &controllers.DocumentController{}, "*:Read")
|
|
|
|
beego.Router("/docs/:key/search", &controllers.DocumentController{}, "post:Search")
|
2018-01-25 19:18:59 +08:00
|
|
|
beego.Router("/export/:key", &controllers.DocumentController{}, "*:Export")
|
2017-12-20 16:16:41 +08:00
|
|
|
beego.Router("/qrcode/:key.png", &controllers.DocumentController{}, "get:QrCode")
|
|
|
|
|
|
|
|
beego.Router("/attach_files/:key/:attach_id", &controllers.DocumentController{}, "get:DownloadAttachment")
|
|
|
|
|
|
|
|
beego.Router("/comment/create", &controllers.CommentController{}, "post:Create")
|
|
|
|
beego.Router("/comment/lists", &controllers.CommentController{}, "get:Lists")
|
|
|
|
beego.Router("/comment/index", &controllers.CommentController{}, "*:Index")
|
|
|
|
|
|
|
|
beego.Router("/search", &controllers.SearchController{}, "get:Index")
|
|
|
|
|
|
|
|
beego.Router("/tag/:key", &controllers.LabelController{}, "get:Index")
|
|
|
|
beego.Router("/tags", &controllers.LabelController{}, "get:List")
|
2018-11-20 20:36:14 +08:00
|
|
|
|
2021-03-23 15:09:17 +08:00
|
|
|
beego.Router("/items", &controllers.ItemsetsController{}, "get:Index")
|
|
|
|
beego.Router("/items/:key", &controllers.ItemsetsController{}, "get:List")
|
2018-11-20 20:36:14 +08:00
|
|
|
|
2017-04-19 18:19:27 +08:00
|
|
|
}
|