commentService

package
v0.0.0-...-b754639 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2015 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignRelatedUser

func AssignRelatedUser(comments []model.Comment)

AssignRelatedUser assign related user of comment.

func CreateComment

func CreateComment(c *gin.Context, item interface{}) (int, error)

CreateComment creates a comment.

func DeleteComment

func DeleteComment(c *gin.Context, item interface{}) (int, error)

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.

func UpdateComment

func UpdateComment(c *gin.Context, item interface{}) (int, error)

UpdateComment updates a comment.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL