comments

package
v0.0.0-...-e39f719 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteComment

func DeleteComment(commentId string) error

Types

type AddCommentData

type AddCommentData struct {
	UserId    primitive.ObjectID `json:"userId" bson:"userId"`
	CourseId  primitive.ObjectID `json:"courseId" bson:"courseId"`
	CreatedAt time.Time          `json:"createdAt" bson:"createdAt"`
	Text      string             `json:"text" bson:"text"`
	Rating    float64            `json:"rating" bson:"rating"`
}

type Comment

type Comment struct {
	Id        primitive.ObjectID `json:"id" bson:"_id"`
	UserId    primitive.ObjectID `json:"userId" bson:"userId"`
	CourseId  primitive.ObjectID `json:"courseId" bson:"courseId"`
	CreatedAt time.Time          `json:"createdAt" bson:"createdAt"`
	Text      string             `json:"text" bson:"text"`
	Rating    float64            `json:"rating" bson:"rating"`
}

func AddComment

func AddComment(data *AddCommentData) (Comment, error)

func GetComment

func GetComment(courseId interface{}) (Comment, error)

func GetComments

func GetComments(query *CommentsQuery) ([]Comment, error)

type CommentsQuery

type CommentsQuery struct {
	Limit  int64  `query:"limit"`
	Skip   int64  `query:"skip"`
	Sort   string `query:"sort"`
	Course string `query:"course"`
}

Jump to

Keyboard shortcuts

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