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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateType uint32 = 1
	DeleteType uint32 = 2
)

Variables

View Source
var (
	ErrCommentTextEmpty  = errors.New("comment text is empty")
	ErrInValidActionType = errors.New("invalid action type")
	ErrInvalidId         = errors.New("invalid id")
)

ProviderSet is biz providers.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	Id         uint32
	User       *User
	Content    string
	CreateDate string
}

type CommentRepo

type CommentRepo interface {
	CreateComment(context.Context, uint32, string) (*Comment, error)
	DeleteComment(context.Context, uint32, uint32) (*Comment, error)
	GetComments(context.Context, uint32) ([]*Comment, error)
}

type CommentUseCase

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

func NewCommentUseCase

func NewCommentUseCase(cr CommentRepo, logger log.Logger) *CommentUseCase

func (*CommentUseCase) CommentAction

func (uc *CommentUseCase) CommentAction(
	ctx context.Context, videoId, commentId uint32,
	actionType uint32, commentText string,
) (*Comment, error)

func (*CommentUseCase) GetCommentList

func (uc *CommentUseCase) GetCommentList(
	ctx context.Context, videoId uint32,
) ([]*Comment, error)

type User

type User struct {
	Id              uint32
	Name            string
	Avatar          string
	BackgroundImage string
	Signature       string
	IsFollow        bool
	FollowCount     uint32
	FollowerCount   uint32
	TotalFavorited  uint32
	WorkCount       uint32
	FavoriteCount   uint32
}

Jump to

Keyboard shortcuts

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