mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
20 lines
515 B
Go
20 lines
515 B
Go
package useCases
|
|
|
|
import "RenewCMS/internal/domain/article"
|
|
|
|
type GetArticleUseCase struct {
|
|
articleRepository article.Repository
|
|
}
|
|
|
|
func NewGetArticleUseCase(articleRepository article.Repository) *GetArticleUseCase {
|
|
return &GetArticleUseCase{articleRepository}
|
|
}
|
|
|
|
func (g *GetArticleUseCase) GetArticle(id uint32) (article.Article, error) {
|
|
return g.articleRepository.Get(id)
|
|
}
|
|
|
|
func (g *GetArticleUseCase) GetArticleByName(name string) (article.Article, error) {
|
|
return g.articleRepository.GetByName(name)
|
|
}
|