Documentation ¶
Index ¶
- Variables
- func Add(ctx context.Context, req *favorite.FavoriteActionRequest) error
- func CheckUserExistById(user_id int64) (bool, error)
- func CheckVideoExistById(video_id int64) (bool, error)
- func Delete(ctx context.Context, req *favorite.FavoriteActionRequest) error
- func GetFavoriteCountByUserID(user_id int64) (int64, error)
- func GetFavoriteIdList(ctx context.Context, user_id int64) ([]int64, error)
- func Init()
- func QueryFavoriteCount(ctx context.Context, video_id int64) (int64, error)
- func QueryIsFavorite(ctx context.Context, req *favorite.IsFavoriteRequest) (bool, error)
- func QueryTotalFavoritedByAuthorID(user_id int64) (int64, error)
- type Favorite
- type User
- type Video
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
func CheckUserExistById ¶
CheckUserExistById find if user exists
func CheckVideoExistById ¶
CheckVideoExistById query if video exist
func GetFavoriteCountByUserID ¶
GetFavoriteCountByUserID get the num of the video liked by user
func GetFavoriteIdList ¶
func QueryFavoriteCount ¶
QueryFavoriteCount favorite_count video_id how many people like
func QueryIsFavorite ¶
QueryIsFavorite user_id like video_id
func QueryTotalFavoritedByAuthorID ¶
QueryTotalFavoritedByAuthorID 获取该作者的获赞数
Types ¶
type User ¶
type User struct { gorm.Model ID int64 `gorm:"primaryKey";json:"id"` UserName string `gorm:"type:varchar(255)"json:"user_name"` Password string `gorm:"type:varchar(255)"json:"password"` Avatar string `gorm:"type:varchar(255)"json:"avatar"` // 用户头像 URL BackgroundImage string `gorm:"type:varchar(255)"json:"background_image"` // 用户背景图 URL Signature string `gorm:"type:varchar(255)"json:"signature"` // 用户个性签名 }
Click to show internal directories.
Click to hide internal directories.