pack

package
v0.0.0-...-8f4e997 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Comment

func Comment(ctx context.Context, m *db.Comment, myID int64) (*userplat.Comment, error)

func Comments

func Comments(ctx context.Context, ms []*db.Comment, myID int64, vdID int64) ([]*userplat.Comment, error)

func DBUserToRPCUser

func DBUserToRPCUser(m *db.User, fromID int64) (*userplat.User, error)

func User

func User(m *db.User) *userplat.User

func Video

func Video(ctx context.Context, m *db.Video, myID int64) (*userplat.Video, error)

传入的是 数据库的原始值 这里返回的应该是封装好了 用于 rpc 的值.

func Videos

func Videos(ctx context.Context, ms []*db.Video, myID int64) ([]*userplat.Video, error)

Types

type Follow

type Follow struct {
	gorm.Model
	ID         int64     `gorm:"column:id;primary_key;AUTO_INCREMENT"`
	FollowTime time.Time `gorm:"column:follow_time;default:CURRENT_TIMESTAMP;NOT NULL"`
	FromUserID int64     `gorm:"column:from_user_id;NOT NULL"`
	ToUserID   int64     `gorm:"column:to_user_id;NOT NULL"`
}

func (*Follow) TableName

func (m *Follow) TableName() string

type Like

type Like struct {
	gorm.Model
	ID       int64     `gorm:"column:id;primary_key;AUTO_INCREMENT"`
	LikeTime time.Time `gorm:"column:like_time;default:CURRENT_TIMESTAMP;NOT NULL"`
	UserID   int64     `gorm:"column:user_id;NOT NULL"`
	VideoID  int64     `gorm:"column:video_id;NOT NULL"`
}

func (*Like) TableName

func (m *Like) TableName() string

Jump to

Keyboard shortcuts

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