thread

package
v0.0.0-...-692bca9 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewThreadServiceImpl

func NewThreadServiceImpl(
	threadRepository thread.ThreadRepository,
	categoryRepository category.CategoryRepository,
	userRepository user.UserRepository,
	idGenerator generator.IDGenerator,
) *threadServiceImpl

Types

type ThreadService

type ThreadService interface {
	GetAll(
		ctx context.Context,
		accessorUserID string,
		page uint,
		limit uint,
		query string,
	) (rs response.Pagination[response.ManyThread], err error)

	Create(
		ctx context.Context,
		accessorUserID string,
		p payload.CreateThread,
	) (id string, err error)

	GetByID(
		ctx context.Context,
		accessorUserID string,
		ID string,
	) (rs response.Thread, err error)

	Update(
		ctx context.Context,
		accessorUserID string,
		ID string,
		p payload.UpdateThread,
	) (err error)

	Delete(
		ctx context.Context,
		accessorUserID string,
		role string,
		ID string,
	) (err error)

	GetComments(
		ctx context.Context,
		threadID string,
		page uint,
		limit uint,
	) (rs response.Pagination[response.Comment], err error)

	CreateComment(
		ctx context.Context,
		threadID string,
		accessorUserID string,
		p payload.CreateComment,
	) (id string, err error)

	ChangeFollowingState(
		ctx context.Context,
		threadID string,
		accessorUserID string,
	) (err error)

	ChangeLikeState(
		ctx context.Context,
		threadID string,
		accessorUserID string,
	) (err error)

	AddModerator(
		ctx context.Context,
		p payload.AddRemoveModerator,
		threadID string,
		accessorUserID string,
	) (err error)

	RemoveModerator(
		ctx context.Context,
		p payload.AddRemoveModerator,
		threadID string,
		accessorUserID string,
	) (err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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