biz

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

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Favorite   uint32 = 1
	UnFavorite uint32 = 2
)

Variables

View Source
var ErrInValidActionType = errors.New("invalid action type")

ProviderSet is biz providers.

Functions

This section is empty.

Types

type FavoriteRepo

type FavoriteRepo interface {
	GetFavoriteList(ctx context.Context, userID uint32) ([]Video, error)
	IsFavorite(ctx context.Context, userID uint32, videoID []uint32) ([]bool, error)
	DeleteFavorite(ctx context.Context, userID uint32, videoID uint32) error
	CreateFavorite(ctx context.Context, userID uint32, videoID uint32) error
}

type FavoriteUseCase

type FavoriteUseCase struct {
	// contains filtered or unexported fields
}

func NewFavoriteUseCase

func NewFavoriteUseCase(repo FavoriteRepo, logger log.Logger) *FavoriteUseCase

func (*FavoriteUseCase) FavoriteAction

func (uc *FavoriteUseCase) FavoriteAction(ctx context.Context, videoId, actionType uint32) error

func (*FavoriteUseCase) GetFavoriteList

func (uc *FavoriteUseCase) GetFavoriteList(ctx context.Context, userID uint32) ([]Video, error)

func (*FavoriteUseCase) IsFavorite

func (uc *FavoriteUseCase) IsFavorite(ctx context.Context, userID uint32, videoIDs []uint32) ([]bool, error)

type PublishRepo

type PublishRepo interface {
	GetVideoListByVideoIds(ctx context.Context, userId uint32, videoIds []uint32) ([]Video, error)
}

type User

type User struct {
	Id              uint32
	Name            string
	FollowCount     uint32
	FollowerCount   uint32
	IsFollow        bool
	Avatar          string
	BackgroundImage string
	Signature       string
	TotalFavorited  uint32 // 总获赞数
	WorkCount       uint32
	FavoriteCount   uint32 // 点赞数量
}

type Video

type Video struct {
	Id            uint32
	Author        *User
	PlayUrl       string
	CoverUrl      string
	FavoriteCount uint32
	CommentCount  uint32
	IsFavorite    bool
	Title         string
}

Jump to

Keyboard shortcuts

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