model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const TableNameComment = "comment"
View Source
const TableNameFavorite = "favorite"
View Source
const TableNameFollow = "follow"
View Source
const TableNameMessage = "message"
View Source
const TableNameUser = "user"
View Source
const TableNameVideo = "video"

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	ID        int64          `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"`
	UserID    int64          `gorm:"column:user_id;type:bigint;not null;comment:用户id" json:"user_id"`                                         // 用户id
	VideoID   int64          `gorm:"column:video_id;type:bigint;not null;index:idx_comment_video_id,priority:1;comment:视频id" json:"video_id"` // 视频id
	Content   string         `gorm:"column:content;type:varchar(255);not null;comment:评论内容" json:"content"`                                   // 评论内容
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);comment:评论发布日期" json:"create_date"`                                    // 评论发布日期
	DeletedAt gorm.DeletedAt ``                                                                                                               // 评论删除日期
	/* 127-byte string literal not displayed */
}

Comment mapped from table <comment>

func (*Comment) TableName

func (*Comment) TableName() string

TableName Comment's table name

type Favorite

type Favorite struct {
	ID     int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"`
	UserID int64 `` // 用户id
	/* 164-byte string literal not displayed */
	VideoID int64 `` // 视频id
	/* 167-byte string literal not displayed */
	Cancel int32 `gorm:"column:cancel;type:tinyint;not null;comment:取消赞是1,默认0" json:"cancel"` // 取消赞是1,默认0
}

Favorite mapped from table <favorite>

func (*Favorite) TableName

func (*Favorite) TableName() string

TableName Favorite's table name

type Follow

type Follow struct {
	ID     int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"`
	UserID int64 `` // 用户id即被关注的用户
	/* 182-byte string literal not displayed */
	FollowerID int64 `` // 关注者id
	/* 174-byte string literal not displayed */
	Cancel int32 `gorm:"column:cancel;type:tinyint;not null;comment:取消关注是1,默认0" json:"cancel"` // 取消关注是1,默认0
}

Follow mapped from table <follow>

func (*Follow) TableName

func (*Follow) TableName() string

TableName Follow's table name

type Message

type Message struct {
	ID       int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"`
	ToUserID int64 `` // 消息接收者id
	/* 142-byte string literal not displayed */
	FromUserID int64 `` // 消息发送者id
	/* 146-byte string literal not displayed */
	Content   string    `gorm:"column:content;type:varchar(255);not null;comment:消息内容" json:"content"` // 消息内容
	CreatedAt time.Time ``                                                                             // 消息发送时间
	/* 127-byte string literal not displayed */
}

Message mapped from table <message>

func (*Message) TableName

func (*Message) TableName() string

TableName Message's table name

type User

type User struct {
	ID              int64  `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"`
	Name            string `gorm:"column:name;type:varchar(255);not null;uniqueIndex:uq_user_name,priority:1;comment:用户名" json:"name"` // 用户名
	Password        string `gorm:"column:password;type:varchar(255);not null;comment:密码" json:"password"`                              // 密码
	Signature       string `gorm:"column:signature;type:varchar(255);not null;comment:个人简介" json:"signature"`                          // 个人简介
	Avatar          string `gorm:"column:avatar;type:varchar(255);not null;comment:头像" json:"avatar"`                                  // 头像
	BackgroundImage string `gorm:"column:background_image;type:varchar(255);comment:用户个人页顶部大图" json:"background_image"`                // 用户个人页顶部大图
}

User mapped from table <user>

func (*User) TableName

func (*User) TableName() string

TableName User's table name

type Video

type Video struct {
	ID        int64     `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"`
	AuthorID  int64     `gorm:"column:author_id;type:bigint;not null;index:idx_video_author_id,priority:1;comment:作者信息" json:"author_id"` // 作者信息
	PlayURL   string    `gorm:"column:play_url;type:varchar(255);not null;comment:播放地址" json:"play_url"`                                  // 播放地址
	CoverURL  string    `gorm:"column:cover_url;type:varchar(255);not null;comment:封面地址" json:"cover_url"`                                // 封面地址
	CreatedAt time.Time `gorm:"column:created_at;type:datetime(3);comment:发布时间" json:"publish_time"`                                      // 发布时间
	Title     string    `gorm:"column:title;type:varchar(255);not null;comment:标题" json:"title"`                                          // 标题
}

Video mapped from table <video>

func (*Video) TableName

func (*Video) TableName() string

TableName Video's table name

Jump to

Keyboard shortcuts

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