Skip to content

Commit

Permalink
fix #27, add discuss component
Browse files Browse the repository at this point in the history
  • Loading branch information
sunface committed Sep 11, 2019
1 parent ce09735 commit 90d1f4b
Show file tree
Hide file tree
Showing 27 changed files with 1,165 additions and 182 deletions.
10 changes: 8 additions & 2 deletions internal/api_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ func apiHandler(e *echo.Echo) {
e.POST("/web/article/saveChanges", post.SaveArticleChanges, session.CheckSignIn)

// comment apis
e.POST("/web/post/comment", post.Comment, session.CheckSignIn)
e.GET("/web/post/queryComments", post.QueryComments)
e.POST("/web/comment/create", post.Comment, session.CheckSignIn)
e.POST("/web/comment/reply", post.CommentReply, session.CheckSignIn)
e.POST("/web/comment/edit", post.EditComment, session.CheckSignIn)
e.POST("/web/comment/delete", post.DeleteComment, session.CheckSignIn)
e.POST("/web/comment/revert", post.RevertComment, session.CheckSignIn)
e.GET("/web/comment/query", post.QueryComments)
e.POST("/web/comment/like", post.CommentLike, session.CheckSignIn)
e.POST("/web/comment/dislike", post.CommentDislike, session.CheckSignIn)
}
6 changes: 6 additions & 0 deletions internal/ecode/ecode.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ const (
PostNotFound = 1101
PostNotFoundMsg = "Target post not found"
)

// comment
const (
CommentLiked = 1200
CommentLikedMsg = "You have agreed this comment before"
)
Loading

0 comments on commit 90d1f4b

Please sign in to comment.