usecase

package
v0.0.0-...-cba9ae1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type CategoryUsecase

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

func (*CategoryUsecase) CreateCategory

func (cu *CategoryUsecase) CreateCategory(ctx context.Context, catName model.CategoryName) (model.Category, error)

func (*CategoryUsecase) DeleteCategoryByName

func (cu *CategoryUsecase) DeleteCategoryByName(ctx context.Context, catName model.CategoryName) error

func (*CategoryUsecase) GetAllCategories

func (cu *CategoryUsecase) GetAllCategories(ctx context.Context) ([]model.Category, error)

func (*CategoryUsecase) GetCategoryByName

func (cu *CategoryUsecase) GetCategoryByName(ctx context.Context, catName model.CategoryName) (model.Category, error)

func (*CategoryUsecase) UpdateCategoryByName

func (cu *CategoryUsecase) UpdateCategoryByName(ctx context.Context, oldCatName model.CategoryName, newCatName model.CategoryName) (model.Category, error)

type ChatUsecase

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

func (*ChatUsecase) CreateChatByThreadId

func (cu *ChatUsecase) CreateChatByThreadId(ctx context.Context, req model.ChatOperationReq) (model.Chat, error)

func (*ChatUsecase) DeleteChatByChatId

func (cu *ChatUsecase) DeleteChatByChatId(ctx context.Context, req model.ChatOperationReq) error

func (*ChatUsecase) GetAllChatByThreadId

func (cu *ChatUsecase) GetAllChatByThreadId(ctx context.Context, req model.ChatQueryReq) ([]model.Chat, error)

func (*ChatUsecase) UpdateChatByChatId

func (cu *ChatUsecase) UpdateChatByChatId(ctx context.Context, req model.ChatOperationReq) (model.Chat, error)

type ICategoryUsecase

type ICategoryUsecase interface {
	GetAllCategories(ctx context.Context) ([]model.Category, error)
	GetCategoryByName(ctx context.Context, catName model.CategoryName) (model.Category, error)
	CreateCategory(ctx context.Context, catName model.CategoryName) (model.Category, error)
	UpdateCategoryByName(ctx context.Context, oldCatName model.CategoryName, newCatName model.CategoryName) (model.Category, error)
	DeleteCategoryByName(ctx context.Context, catName model.CategoryName) error
}

type IChatUsecase

type IChatUsecase interface {
	GetAllChatByThreadId(ctx context.Context, req model.ChatQueryReq) ([]model.Chat, error)
	CreateChatByThreadId(ctx context.Context, req model.ChatOperationReq) (model.Chat, error)
	UpdateChatByChatId(ctx context.Context, req model.ChatOperationReq) (model.Chat, error)
	DeleteChatByChatId(ctx context.Context, req model.ChatOperationReq) error
}

type IThreadUsecase

type IThreadUsecase interface {
	GetAllThread(ctx context.Context, req model.ThreadQueryReq) ([]model.Thread, error)
	GetThreadById(ctx context.Context, req model.ThreadQueryReq) (model.Thread, error)
	CreateThread(ctx context.Context, req model.ThreadOperationReq) (model.Thread, error)
	UpdateThreadById(ctx context.Context, req model.ThreadOperationReq) (model.Thread, error)
	DeleteThreadById(ctx context.Context, req model.ThreadOperationReq) error
}

type IUserUsecase

type IUserUsecase interface {
	RedirectOauthURL(state string) string
	GoogleSigninOrSinup(ctx context.Context, code string) (*model.User, error)

	GetAllUser(ctx context.Context) ([]model.User, error)
	GetUserByNickName(ctx context.Context, nickName model.NickName) (model.User, error)
	UpdateUserByGoogleId(ctx context.Context, googleId model.GoogleId, user model.User) (model.User, error)
	CreateUser(ctx context.Context, user *model.User) error
	DeleteUserByGoogleId(ctx context.Context, googleId model.GoogleId) error
}

type ThreadUsecase

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

func (*ThreadUsecase) CreateThread

func (tu *ThreadUsecase) CreateThread(ctx context.Context, req model.ThreadOperationReq) (model.Thread, error)

func (*ThreadUsecase) DeleteThreadById

func (tu *ThreadUsecase) DeleteThreadById(ctx context.Context, req model.ThreadOperationReq) error

func (*ThreadUsecase) GetAllThread

func (tu *ThreadUsecase) GetAllThread(ctx context.Context, req model.ThreadQueryReq) ([]model.Thread, error)

func (*ThreadUsecase) GetThreadById

func (tu *ThreadUsecase) GetThreadById(ctx context.Context, req model.ThreadQueryReq) (model.Thread, error)

func (*ThreadUsecase) UpdateThreadById

func (tu *ThreadUsecase) UpdateThreadById(ctx context.Context, req model.ThreadOperationReq) (model.Thread, error)

type UserUsecase

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

func NewUserUsecase

func NewUserUsecase(repo repository.UserRepository, auth auth.IGoogle) *UserUsecase

func (*UserUsecase) CreateUser

func (uu *UserUsecase) CreateUser(ctx context.Context, user *model.User) error

func (*UserUsecase) DeleteUserByGoogleId

func (uu *UserUsecase) DeleteUserByGoogleId(ctx context.Context, googleId model.GoogleId) error

func (*UserUsecase) GetAllUser

func (uu *UserUsecase) GetAllUser(ctx context.Context) ([]model.User, error)

func (*UserUsecase) GetUserByNickName

func (uu *UserUsecase) GetUserByNickName(ctx context.Context, nickName model.NickName) (model.User, error)

func (*UserUsecase) GoogleSigninOrSinup

func (uu *UserUsecase) GoogleSigninOrSinup(ctx context.Context, code string) (*model.User, error)

func (*UserUsecase) RedirectOauthURL

func (uu *UserUsecase) RedirectOauthURL(state string) string

func (*UserUsecase) UpdateUserByGoogleId

func (uu *UserUsecase) UpdateUserByGoogleId(ctx context.Context, googleId model.GoogleId, user model.User) (model.User, error)

Jump to

Keyboard shortcuts

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