db

package
v0.0.0-...-9bdafd8 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func CancelCommentByCommentID

func CancelCommentByCommentID(ctx context.Context, commentID int64) error

func CancelFavorite

func CancelFavorite(ctx context.Context, userID int64, videoID int64) error

func CreateComment

func CreateComment(ctx context.Context, comment []*Comment) error

func CreateFavorite

func CreateFavorite(ctx context.Context, favorite []*Favorite) error

func Init

func Init()

Init init DB

Types

type Comment

type Comment struct {
	gorm.Model
	VideoID     int64
	UserID      int64
	CommentText string
}

func QueryCommentByVideoID

func QueryCommentByVideoID(ctx context.Context, videoID int64) ([]*Comment, error)

func (Comment) TableName

func (f Comment) TableName() string

type Favorite

type Favorite struct {
	gorm.Model
	UserID  int64
	VideoID int64
}

func QueryFavoriteByUserID

func QueryFavoriteByUserID(ctx context.Context, userID int64) ([]*Favorite, error)

func QueryFavoriteByUserIDAndVideoID

func QueryFavoriteByUserIDAndVideoID(ctx context.Context, userID int64, videoID int64) ([]*Favorite, error)

func QueryFavoriteByVideoID

func QueryFavoriteByVideoID(ctx context.Context, videoID int64) ([]*Favorite, error)

func (Favorite) TableName

func (f Favorite) TableName() string

Jump to

Keyboard shortcuts

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