usecase

package
v0.0.0-...-2fe0e47 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient(port string) (auth.AuthorizationClient, error)

Types

type Core

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

func GetCore

func GetCore(cfg_sql *configs.CommentCfg, lg *slog.Logger, comments comment.ICommentRepo) *Core

func (*Core) AddComment

func (core *Core) AddComment(filmId uint64, userId uint64, rating uint16, text string) (bool, error)

func (*Core) DeleteComment

func (core *Core) DeleteComment(idUser uint64, idFilm uint64) error

func (*Core) GetFilmComments

func (core *Core) GetFilmComments(filmId uint64, first uint64, limit uint64) ([]models.CommentItem, error)

func (*Core) GetUserId

func (core *Core) GetUserId(ctx context.Context, sid string) (uint64, error)

type ICore

type ICore interface {
	GetFilmComments(filmId uint64, first uint64, limit uint64) ([]models.CommentItem, error)
	AddComment(filmId uint64, userId uint64, rating uint16, text string) (bool, error)
	GetUserId(ctx context.Context, sid string) (uint64, error)
	DeleteComment(idUser uint64, idFilm uint64) error
}

Jump to

Keyboard shortcuts

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