model

package
v0.0.0-...-671c73a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	DefaultModel
	AuthorId   int64  `mapstructure:"author_id" gorm:"comment:作者ID"`
	VideoId    int64  `mapstructure:"video_id" gorm:"comment:视频ID"`
	Content    string `mapstructure:"content" gorm:"comment:评论内容"`
	CreateTime string `mapstructure:"create_time" gorm:"comment:评论时间"`
}

type DefaultModel

type DefaultModel struct {
	Id        int64 `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type Favorite

type Favorite struct {
	DefaultModel
	UserId  int64 `mapstructure:"user_id" gorm:"comment:用户ID"`
	VideoId int64 `mapstructure:"video_id" gorm:"comment:点赞的视频ID"`
}

type Message

type Message struct {
	DefaultModel
	ToUserId   int64  `mapstructure:"to_user_id" gorm:"comment:接收用户ID"`
	FromUserId int64  `mapstructure:"from_user_id" gorm:"comment:发送用户ID"`
	Content    string `mapstructure:"content" gorm:"comment:消息内容"`
	CreateTime string `mapstructure:"create_time" gorm:"comment:发送时间"`
}

type MongoComment

type MongoComment struct {
	AuthorId   int64  `bson:"author_id"`
	VideoId    int64  `bson:"video_id"`
	Content    string `bson:"content"`
	CreateTime string `bson:"create_time"`
}

type MongoMessage

type MongoMessage struct {
	Sender    int64  `bson:"sender"`
	Receiver  int64  `bson:"receiver"`
	Content   string `bson:"content"`
	Timestamp int64  `bson:"timestamp"`
}

type Relation

type Relation struct {
	DefaultModel
	UserId       int64 `mapstructure:"user_id" gorm:"comment:用户ID"`
	FollowUserId int64 `mapstructure:"follow_user_id" gorm:"comment:关注的用户ID"`
}

type User

type User struct {
	DefaultModel
	//UUID            uuid.UUID `mapstructure:"-" gorm:"index;comment:用户UUID"`
	Username        string `mapstructure:"-" gorm:"comment:用户登录名"`
	Password        string `mapstructure:"-" gorm:"comment:用户登录密码"`
	Nickname        string `mapstructure:"nickname" gorm:"comment:用户昵称"`
	Avatar          string `mapstructure:"avatar" gorm:"comment:头像"`
	BackgroundImage string `mapstructure:"background_image" gorm:"comment:主页背景图"`
	Signature       string `mapstructure:"signature" gorm:"default:系统原装签名,送给每个小可爱。;comment:个性签名"`
	FollowCount     int64  `mapstructure:"follow_count" gorm:"default:0;comment:关注数"`
	FollowerCount   int64  `mapstructure:"follower_count" gorm:"default:0;comment:粉丝数"`
	TotalFavorited  int64  `mapstructure:"total_favorited" gorm:"default:0;comment:获赞数"`
	FavoriteCount   int64  `mapstructure:"favorite_count" gorm:"default:0;comment:点赞数"`
	WorkCount       int64  `mapstructure:"work_count" gorm:"default:0;comment:作品数"`
}

type Video

type Video struct {
	DefaultModel
	AuthorId      int64  `mapstructure:"author_id" gorm:"comment:作者ID"`
	Title         string `mapstructure:"title" gorm:"comment:标题"`
	VideoPath     string `mapstructure:"video_path" gorm:"comment:视频地址/路径"`
	CoverPath     string `mapstructure:"cover_path" gorm:"comment:封面地址/路径"`
	FavoriteCount int64  `mapstructure:"favorite_count" gorm:"default:0;comment:获赞数"`
	CommentCount  int64  `mapstructure:"comment_count" gorm:"default:0;comment:评论数"`
}

Jump to

Keyboard shortcuts

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