comment

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const FirstCommentsNumber = 3

FirstCommentsNumber 直接记录在Comment中的子评论个数

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	Id            int64
	VideoId       int64
	UserId        int64
	ParentId      *int64
	ToUserId      *int64
	Content       string
	Date          string
	CreateTime    time.Time
	Comments      []*Comment // 子评论
	ChildNumbers  int64      // 子评论个数
	FirstComments []*Comment // 最初的x条子评论
}

func New

func New(options ...Option) *Comment

func NewWithModel

func NewWithModel(m *model.Comment) *Comment

func (*Comment) AddFirstChildComments

func (c *Comment) AddFirstChildComments(child *Comment)

func (*Comment) GetChildCommentProto

func (c *Comment) GetChildCommentProto() []*v1.Comment

func (*Comment) SetId

func (c *Comment) SetId()

func (*Comment) ToModel

func (c *Comment) ToModel() *model.Comment

func (*Comment) ToProto

func (c *Comment) ToProto() *v1.Comment

type Option

type Option func(*Comment)

func WithContent

func WithContent(content string) Option

func WithParentId

func WithParentId(parentId int64) Option

func WithToUserId

func WithToUserId(toUserId int64) Option

func WithUserId

func WithUserId(userId int64) Option

func WithVideoId

func WithVideoId(videoId int64) Option

Jump to

Keyboard shortcuts

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