-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.go
27 lines (24 loc) · 1.34 KB
/
init.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
package article
import (
"github.com/webx-top/echo"
_ "github.com/admpub/webx/application/handler/frontend/article/user"
"github.com/admpub/webx/application/initialize/frontend"
)
func init() {
frontend.Register(func(g echo.RouteRegister) {
g.Route(`GET`, `/article/<id:\d+>`, Detail).SetName(`article.detail`)
g.Route(`GET`, `/article/<id:\d+>/:op`, Detail).SetName(`article.detailWithOp`)
g.Route(`GET`, `/articlesBy/:sourceTable/:sourceId`, ArticleListBy).SetName(`article.listBy`)
g.Route(`GET`, `/articles`, List).SetName(`article.list`)
g.Route(`POST`, `/article/like`, ArticleLike).SetName(`article.like`)
g.Route(`POST`, `/article/hate`, ArticleHate).SetName(`article.hate`)
g.Route(`POST`, `/article/comment_add`, ArticleCommentAdd).SetName(`article.comment.add`)
g.Route(`GET`, `/article/comment_list`, ArticleCommentList).SetName(`article.comment.list`)
g.Route(`GET`, `/article/comment_reply_list`, ArticleCommentReplyList).SetName(`article.comment.replyList`)
g.Route(`POST`, `/article/comment_like`, CommentLike).SetName(`article.comment.like`)
g.Route(`POST`, `/article/comment_hate`, CommentHate).SetName(`article.comment.hate`)
g.Route(`POST`, `/article/pay/:id`, Pay).SetName(`article.pay`)
g.Route(`GET`, `/article/tags`, Tags).SetName(`article.tags`)
g.Route(`GET`, `/article`, Index).SetName(`article.index`)
})
}