usecase

package
v0.0.0-...-52f6943 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

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

func NewPost

func NewPost(repoPost repository.PostI, repoComment repository.CommentI, logger kitlog.Logger) *Post

func (*Post) CheckHealthReadiness

func (p *Post) CheckHealthReadiness(ctx context.Context) error

func (*Post) CreateCommentOnPost

func (p *Post) CreateCommentOnPost(ctx context.Context, req *model.CreateCommentRequest) error

func (*Post) CreateNewPost

func (p *Post) CreateNewPost(ctx context.Context, requestBody *model.CreateNewPostRequest) error

func (*Post) GetCommentsByPostID

func (p *Post) GetCommentsByPostID(ctx context.Context, req *model.GetCommentRequest) (*model.CommentWithMetadata, error)

func (*Post) GetDetailPost

func (p *Post) GetDetailPost(ctx context.Context, id int64) (*model.UserPostResponse, error)

func (*Post) GetListPost

func (p *Post) GetListPost(ctx context.Context, params *model.GetListRequest) (*model.UserPostWithMetadata, error)

func (*Post) GetListPostByMe

func (p *Post) GetListPostByMe(ctx context.Context, params *model.GetListRequest) (*model.UserPostWithMetadata, error)

func (*Post) LikeOrDislikePost

func (p *Post) LikeOrDislikePost(ctx context.Context, id int64) error

func (*Post) UpdateTitleOrStatus

func (p *Post) UpdateTitleOrStatus(ctx context.Context, requestBody *model.UpdatePostRequest) error

type UsecaseI

type UsecaseI interface {
	GetListPost(ctx context.Context, params *model.GetListRequest) (*model.UserPostWithMetadata, error)
	GetListPostByMe(ctx context.Context, params *model.GetListRequest) (*model.UserPostWithMetadata, error)
	GetDetailPost(ctx context.Context, id int64) (*model.UserPostResponse, error)
	CreateNewPost(ctx context.Context, requestBody *model.CreateNewPostRequest) error
	UpdateTitleOrStatus(ctx context.Context, requestBody *model.UpdatePostRequest) error
	GetCommentsByPostID(ctx context.Context, req *model.GetCommentRequest) (*model.CommentWithMetadata, error)
	CreateCommentOnPost(ctx context.Context, req *model.CreateCommentRequest) error
	LikeOrDislikePost(ctx context.Context, id int64) error
	CheckHealthReadiness(ctx context.Context) error
}

Jump to

Keyboard shortcuts

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