model

package
v0.0.0-...-905bf1f Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Types

type Comment

type Comment struct {
	ID       int64      `gorm:"primaryKey;not null;unique"`
	Content  string     `gorm:"not null"`
	SentAt   time.Time  `gorm:"not null"`
	Responds []Response `gorm:"foreignKey:CommentID;references:ID"`
}

func (*Comment) CreateComment

func (cm *Comment) CreateComment() error

func (*Comment) GetCommentAndResponds

func (cm *Comment) GetCommentAndResponds() error

type Response

type Response struct {
	ID        int64     `gorm:"primaryKey;not null;unique"`
	CommentID int64     `gorm:"not null"`
	Content   string    `gorm:"not null"`
	SentAt    time.Time `gorm:"not null"`
}

func (*Response) CreateResponse

func (rp *Response) CreateResponse() error

Jump to

Keyboard shortcuts

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