mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
refac: renamed 'post' -> 'article'
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package useCases
|
||||
|
||||
import (
|
||||
"GoCMS/domain/article"
|
||||
"GoCMS/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)
|
||||
}
|
||||
Reference in New Issue
Block a user