db

package
v0.0.0-...-7de97a6 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func Init

func Init()

Init 初始化数据库

Types

type Favorite

type Favorite struct {
	gorm.Model
	UserId   int64 `json:"user_id" gorm:"not null;uniqueIndex:user_video"`  //点赞用户id
	VideoId  int64 `json:"video_id" gorm:"not null;uniqueIndex:user_video"` //视频id
	Favorite int32 `json:"favorite"`                                        //是否点赞,1为点赞,2为取消赞
}

Favorite 表的结构。

func (Favorite) TableName

func (Favorite) TableName() string

TableName 修改表名映射

Jump to

Keyboard shortcuts

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