mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
22 lines
433 B
Go
22 lines
433 B
Go
package useCases
|
|
|
|
import (
|
|
. "GohCMS2/adapters/secondary/gateways"
|
|
. "GohCMS2/domain/article"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type ListArticlesUseCase struct {
|
|
articleRepository ArticleRepository
|
|
}
|
|
|
|
func NewListArticlesUseCase(db *gorm.DB) *ListArticlesUseCase {
|
|
return &ListArticlesUseCase{
|
|
articleRepository: *NewArticleRepository(db),
|
|
}
|
|
}
|
|
|
|
func (g *ListArticlesUseCase) ListArticles() []Article {
|
|
return g.articleRepository.GetAll()
|
|
}
|