usecase

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package usecase is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	DeletedCommentContent    string = "삭제된 댓글입니다."
	AnonymousCommentUsername string = "익명"
	AnonymousCommentNickname string = "익명"
	DeletedCommentUsername   string = "삭제된 댓글의 작성자"
	DeletedCommentNickname   string = "삭제된 댓글의 작성자"
)

Functions

This section is empty.

Types

type CommentQueryOption

type CommentQueryOption struct {
	AuthorUsername string
	ArticleID      int
	StudyArticleID int
	CommentId      int
	PostKind       *string
}

type CommentUseCase

type CommentUseCase struct {
	Repo repository.CommentRepository

	SnsClient infra.SnsClient
	// contains filtered or unexported fields
}

func (*CommentUseCase) Create

func (uc *CommentUseCase) Create(username string, commentInput *data.CommentInput) (*data.CommentOutput, error)

func (*CommentUseCase) Delete

func (uc *CommentUseCase) Delete(username string, id int) error

실제로 Delete 하지는 않고 State를 "deleted"로 변경

func (*CommentUseCase) Get

func (uc *CommentUseCase) Get(username string, id int) (*data.CommentOutput, error)

지금의 Get은 Children은 가져오지 못함

func (*CommentUseCase) List

func (uc *CommentUseCase) List(username string, opt *CommentQueryOption) ([]*data.CommentOutput, error)

func (*CommentUseCase) Update

func (uc *CommentUseCase) Update(username string, id int, opt map[string]interface{}) (*data.CommentOutput, error)

type CommentUseCaseInterface

type CommentUseCaseInterface interface {
	Create(username string, commentInput *data.CommentInput) (*data.CommentOutput, error)
	List(username string, opt *CommentQueryOption) ([]*data.CommentOutput, error)
	Get(username string, id int) (*data.CommentOutput, error)
	Update(username string, id int, opt map[string]interface{}) (*data.CommentOutput, error)
	Delete(username string, id int) error
}

func NewCommentUseCase

func NewCommentUseCase(
	repo repository.CommentRepository,
	likeRepo repository.LikeCommentRepository,
	entclient *ent.Client,
	snsClient infra.SnsClient,
	khumuAPIAdapter khumu.KhumuAPIAdapter) CommentUseCaseInterface

type LikeCommentUseCase

type LikeCommentUseCase struct {
	Repo        repository.LikeCommentRepository
	CommentRepo repository.CommentRepository
}

func (*LikeCommentUseCase) Toggle

func (uc *LikeCommentUseCase) Toggle(input *data.LikeCommentInput) (bool, error)

type LikeCommentUseCaseInterface

type LikeCommentUseCaseInterface interface {
	// return value 중 bool이 true면 생성, false면 삭제
	Toggle(like *data.LikeCommentInput) (bool, error)
}

type MockCommentUseCaseInterface

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

MockCommentUseCaseInterface is a mock of CommentUseCaseInterface interface.

func NewMockCommentUseCaseInterface

func NewMockCommentUseCaseInterface(ctrl *gomock.Controller) *MockCommentUseCaseInterface

NewMockCommentUseCaseInterface creates a new mock instance.

func (*MockCommentUseCaseInterface) Create

func (m *MockCommentUseCaseInterface) Create(username string, commentInput *data.CommentInput) (*data.CommentOutput, error)

Create mocks base method.

func (*MockCommentUseCaseInterface) Delete

func (m *MockCommentUseCaseInterface) Delete(username string, id int) error

Delete mocks base method.

func (*MockCommentUseCaseInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCommentUseCaseInterface) Get

func (m *MockCommentUseCaseInterface) Get(username string, id int) (*data.CommentOutput, error)

Get mocks base method.

func (*MockCommentUseCaseInterface) List

List mocks base method.

func (*MockCommentUseCaseInterface) Update

func (m *MockCommentUseCaseInterface) Update(username string, id int, opt map[string]interface{}) (*data.CommentOutput, error)

Update mocks base method.

type MockCommentUseCaseInterfaceMockRecorder

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

MockCommentUseCaseInterfaceMockRecorder is the mock recorder for MockCommentUseCaseInterface.

func (*MockCommentUseCaseInterfaceMockRecorder) Create

func (mr *MockCommentUseCaseInterfaceMockRecorder) Create(username, commentInput interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockCommentUseCaseInterfaceMockRecorder) Delete

func (mr *MockCommentUseCaseInterfaceMockRecorder) Delete(username, id interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockCommentUseCaseInterfaceMockRecorder) Get

func (mr *MockCommentUseCaseInterfaceMockRecorder) Get(username, id interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockCommentUseCaseInterfaceMockRecorder) List

func (mr *MockCommentUseCaseInterfaceMockRecorder) List(username, opt interface{}) *gomock.Call

List indicates an expected call of List.

func (*MockCommentUseCaseInterfaceMockRecorder) Update

func (mr *MockCommentUseCaseInterfaceMockRecorder) Update(username, id, opt interface{}) *gomock.Call

Update indicates an expected call of Update.

type MockLikeCommentUseCaseInterface

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

MockLikeCommentUseCaseInterface is a mock of LikeCommentUseCaseInterface interface.

func NewMockLikeCommentUseCaseInterface

func NewMockLikeCommentUseCaseInterface(ctrl *gomock.Controller) *MockLikeCommentUseCaseInterface

NewMockLikeCommentUseCaseInterface creates a new mock instance.

func (*MockLikeCommentUseCaseInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockLikeCommentUseCaseInterface) Toggle

Toggle mocks base method.

type MockLikeCommentUseCaseInterfaceMockRecorder

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

MockLikeCommentUseCaseInterfaceMockRecorder is the mock recorder for MockLikeCommentUseCaseInterface.

func (*MockLikeCommentUseCaseInterfaceMockRecorder) Toggle

func (mr *MockLikeCommentUseCaseInterfaceMockRecorder) Toggle(like interface{}) *gomock.Call

Toggle indicates an expected call of Toggle.

Jump to

Keyboard shortcuts

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