Documentation ¶
Index ¶
- type BlogUsecase
- func (u *BlogUsecase) CreateArticle(now time.Time, input model.CreateArticleInput, userId int) (*model.Article, error)
- func (u *BlogUsecase) CreateBlog(now time.Time, input model.CreateBlogInput, userId int) (*model.Blog, error)
- func (u *BlogUsecase) DeleteArticle(articleId string, userId int) error
- func (u *BlogUsecase) DeleteBlog(blogId string, userId int) error
- func (u *BlogUsecase) GetArticleByArticleKey(input model.ArticleByArticleKeyInput, passwordInputTime *time.Time, ...) (*model.Article, error)
- func (u *BlogUsecase) GetArticles(input model.BlogByBlogKeyInput, paginationInput model.ArticlePaginationInput, ...) (*model.ArticleConnection, error)
- func (u *BlogUsecase) GetBlogByBlogKey(input model.BlogByBlogKeyInput, passwordInputTime *time.Time, userId *int) (*model.Blog, error)
- func (u *BlogUsecase) GetBlogByID(blogId string, userId int) (*model.Blog, error)
- func (u *BlogUsecase) GetBlogs(userId int) ([]*model.Blog, error)
- func (u *BlogUsecase) IsAuthor(blogKey string, userId int) (bool, error)
- func (u *BlogUsecase) UpdateArticle(now time.Time, input model.UpdateArticleInput, userId int) (*model.Article, error)
- func (u *BlogUsecase) UpdateBlog(now time.Time, input model.UpdateBlogInput, userId int) (*model.Blog, error)
- type IArticleRepository
- type IBlogRepository
- type IMParameterRepository
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 NewBlogUsecase ¶
func NewBlogUsecase(br IBlogRepository, ar IArticleRepository, mr IMParameterRepository) *BlogUsecase
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 (*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)
}
Click to show internal directories.
Click to hide internal directories.