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.CommentList
- 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.CommentList
RetrieveComments retrieves comments.
Types ¶
type CommentForm ¶
type CommentForm struct { CommentId uint `form:"commentId" binding:"required"` Content string `form:"content"` UserId uint `form:"userId" binding:"required"` }
CommentForm is used when updating a comment.
type CreateCommentForm ¶
type CreateCommentForm struct { Content string `form:"content" binding:"required"` UserId uint `form:"userId"` }
CreateCommentForm is used when creating a comment.
Click to show internal directories.
Click to hide internal directories.