blog

package
v0.0.0-...-f270e70 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlogUsecase

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

func (*BlogUsecase) CreateArticle

func (u *BlogUsecase) CreateArticle(now time.Time, input model.CreateArticleInput, userId int) (*model.Article, error)

func (*BlogUsecase) CreateBlog

func (u *BlogUsecase) CreateBlog(now time.Time, input model.CreateBlogInput, userId int) (*model.Blog, error)

func (*BlogUsecase) DeleteArticle

func (u *BlogUsecase) DeleteArticle(articleId string, userId int) error

func (*BlogUsecase) DeleteBlog

func (u *BlogUsecase) DeleteBlog(blogId string, userId int) error

func (*BlogUsecase) GetArticleByArticleKey

func (u *BlogUsecase) GetArticleByArticleKey(input model.ArticleByArticleKeyInput, passwordInputTime *time.Time, userId *int) (*model.Article, error)

func (*BlogUsecase) GetArticles

func (u *BlogUsecase) GetArticles(input model.BlogByBlogKeyInput, paginationInput model.ArticlePaginationInput, passwordInputTime *time.Time, userId *int) (*model.ArticleConnection, error)

func (*BlogUsecase) GetBlogByBlogKey

func (u *BlogUsecase) GetBlogByBlogKey(input model.BlogByBlogKeyInput, passwordInputTime *time.Time, userId *int) (*model.Blog, error)

func (*BlogUsecase) GetBlogByID

func (u *BlogUsecase) GetBlogByID(blogId string, userId int) (*model.Blog, error)

func (*BlogUsecase) GetBlogs

func (u *BlogUsecase) GetBlogs(userId int) ([]*model.Blog, error)

func (*BlogUsecase) IsAuthor

func (u *BlogUsecase) IsAuthor(blogKey string, userId int) (bool, error)

func (*BlogUsecase) UpdateArticle

func (u *BlogUsecase) UpdateArticle(now time.Time, input model.UpdateArticleInput, userId int) (*model.Article, error)

func (*BlogUsecase) UpdateBlog

func (u *BlogUsecase) UpdateBlog(now time.Time, input model.UpdateBlogInput, userId int) (*model.Blog, error)

type IArticleRepository

type IArticleRepository interface {
	FindByBlogId(blogId string, input model.ArticlePaginationInput) ([]*model.Article, error)
	HasPreviousPage(blogId string, input model.ArticlePaginationInput) (bool, error)
	HasNextPage(blogId string, input model.ArticlePaginationInput) (bool, error)
	FindByArticleKey(articleKey string, opts *model.ArticleByKeyOpts, passwordInputTime *time.Time) (*model.Article, error)
	Create(now time.Time, input model.CreateArticleInput, userId int) (*model.Article, error)
	Update(now time.Time, input model.UpdateArticleInput, userId int) (*model.Article, error)
	DeleteById(articleId string, userId int) error
}

type IBlogRepository

type IBlogRepository interface {
	BeginTransaction() (*sql.Tx, error)
	FindByUserId(userId int) ([]*model.Blog, error)
	FindById(blogId string, userId int) (*model.Blog, error)
	FindByBlogKey(blogKey string, opts *model.BlogByKeyOpts, passwordInputTime *time.Time) (*model.Blog, error)
	IsAuthor(blogKey string, userId int) (bool, error)
	CountBlogs(userId int) (*int, error)
	Create(now time.Time, input model.CreateBlogInput, userId int) (*model.Blog, error)
	Update(now time.Time, input model.UpdateBlogInput, userId int) (*model.Blog, error)
	DeleteById(tx *sql.Tx, blogId string, userId int) error
}

type IMParameterRepository

type IMParameterRepository interface {
	Find() (*model.MasterParameter, error)
}

Jump to

Keyboard shortcuts

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