mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
23 lines
557 B
Go
23 lines
557 B
Go
package useCases
|
|
|
|
import (
|
|
"RenewCMS/domain/article"
|
|
"RenewCMS/domain/gateways"
|
|
)
|
|
|
|
type GetArticleUseCase struct {
|
|
articleRepository gateways.IArticleRepository
|
|
}
|
|
|
|
func NewGetArticleUseCase(articleRepository gateways.IArticleRepository) *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)
|
|
}
|