Documentation
¶
Index ¶
- Constants
- func ArticleLike(c echo.Context) error
- func BeforeEditAr(c echo.Context) error
- func Comment(c echo.Context) error
- func CommentDislike(c echo.Context) error
- func CommentLike(c echo.Context) error
- func CommentReply(c echo.Context) error
- func DeleteComment(c echo.Context) error
- func EditComment(c echo.Context) error
- func GetArticleDetail(c echo.Context) error
- func NewArticle(c echo.Context) error
- func Preview(c echo.Context) error
- func QueryComments(c echo.Context) error
- func RevertComment(c echo.Context) error
- func SaveArticleChanges(c echo.Context) error
- type ArContent
- type ArticleDetail
- type CommentContent
- type Comments
Constants ¶
const ( // PostDraft means the post is in draft phase PostDraft = 1 // PostPublished means the post already published PostPublished = 2 // PostDelete means the post has been deleted PostDelete = 3 )
const ( // OpCommentLike means a user like a comment OpCommentLike = 1 // OpCommentDislike means a user dislike a comment OpCommentDislike = 2 // OpPostLike means a user like a post OpPostLike = 1 // OpPostDislike means a user dislike a post OpPostDislike = 2 )
const ( // OpUpdate is the update operation OpUpdate = 1 // OpDelete is the delete operation OpDelete = 2 )
const ( // StatusNormal means post is in normal status StatusNormal = 0 // StatusDeleted means post is deleted StatusDeleted = 1 )
const (
// ArticleType means the post is an ariticle
ArticleType = 1
)
Variables ¶
This section is empty.
Functions ¶
func ArticleLike ¶
ArticleLike means a user like this article
func BeforeEditAr ¶
BeforeEditAr deal some pre-things before editing article
func CommentDislike ¶
CommentDislike indicates that a user dislike a Comment
func CommentLike ¶
CommentLike indicates that a user like/dislike a Comment
func CommentReply ¶
CommentReply is the action that user make commention to one post
func DeleteComment ¶
DeleteComment delete the comment Only comment author can do this
func GetArticleDetail ¶
GetArticleDetail return detail data of the article
func QueryComments ¶
QueryComments return the comments by post id
func RevertComment ¶
RevertComment revert the comment from delete status Only comment owner and post author can do this
func SaveArticleChanges ¶
SaveArticleChanges save changes when edit article
Types ¶
type ArContent ¶
type ArContent struct { ID string `json:"id"` Title string `json:"title"` Tags []string `json:"tags"` MD string `json:"md"` Render string `json:"render"` Lang string `json:"lang"` Status int `json:"status"` CoverImage string `json:"cover_image"` }
ArContent represent article content
type ArticleDetail ¶
type ArticleDetail struct { ID string `json:"id"` UID string `json:"uid"` Title string `json:"title"` Tags []string `json:"tags"` Render string `json:"render"` Status int `json:"status"` PublishDate string `json:"publish_date"` EditDate string `json:"edit_date"` Lang string `json:"lang"` Words int `json:"words"` Likes int `json:"likes"` // all likes of this article Liked bool `json:"liked"` // current user liked this article CoverImage string `json:"cover_image"` // contains filtered or unexported fields }
ArticleDetail contains detail data of article
type CommentContent ¶
type CommentContent struct { ID string `json:"id"` PID string `json:"pid"` Depth int `json:"depth"` MD string `json:"md"` Render string `json:"render"` UID string `json:"uid"` UName string `json:"uname"` UNickname string `json:"unickname"` PublishDate string `json:"date"` EditDate string `json:"edit_date,omitempty"` Likes int `json:"likes"` Liked int `json:"liked"` // current login user's liked to the comment, 0 normal, 1 liked, 2 disliked Status int `json:"status"` // contains filtered or unexported fields }
CommentContent holds the comment content