Documentation ¶
Index ¶
- func AssignRelatedUser(comments []model.Comment)
- func CreateComment(c *gin.Context, item interface{}) (int, error)
- func DeleteComment(c *gin.Context, item interface{}) (int, error)
- func RetrieveComments(item interface{}, currentPages ...int) ([]model.Comment, int, bool, bool, int)
- func SetCommentPageMeta(commentList *model.CommentList, currentPage int, hasPrev bool, hasNext bool, ...)
- func UpdateComment(c *gin.Context, item interface{}) (int, error)
- type CommentForm
- type CreateCommentForm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignRelatedUser ¶
AssignRelatedUser assign related user of comment.
func CreateComment ¶
CreateComment creates a comment.
func DeleteComment ¶
DeleteComment deletes a comment.
func RetrieveComments ¶
func RetrieveComments(item interface{}, currentPages ...int) ([]model.Comment, int, bool, bool, int)
RetrieveComments retrieves comments.
func SetCommentPageMeta ¶
func SetCommentPageMeta(commentList *model.CommentList, currentPage int, hasPrev bool, hasNext bool, count int)
SetCommentPageMeta set comment's page meta.
Types ¶
type CommentForm ¶
type CommentForm struct { CommentId int64 `form:"commentId" binding:"required"` ParentId int64 `form:"parentId" binding:"required"` Content string `form:"content"` }
CommentForm is used when updating a comment.
type CreateCommentForm ¶
type CreateCommentForm struct { UserId int64 `form:"userId" binding:"required"` ParentId int64 `form:"parentId" binding:"required"` Content string `form:"content" binding:"required"` }
CreateCommentForm is used when creating a comment.
Click to show internal directories.
Click to hide internal directories.