commentService

package
v0.0.0-...-dffa276 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 12 Imported by: 6

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.CommentList

RetrieveComments retrieves comments.

func UpdateComment

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

UpdateComment updates a comment.

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.

Jump to

Keyboard shortcuts

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