mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
22 lines
436 B
Go
22 lines
436 B
Go
package useCases
|
|
|
|
import (
|
|
. "GohCMS2/adapters/secondary/gateways"
|
|
. "GohCMS2/domain/article"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type GetArticleUseCase struct {
|
|
articleRepository ArticleRepository
|
|
}
|
|
|
|
func NewGetArticleUseCase(db *gorm.DB) *GetArticleUseCase {
|
|
return &GetArticleUseCase{
|
|
articleRepository: *NewArticleRepository(db),
|
|
}
|
|
}
|
|
|
|
func (g *GetArticleUseCase) GetArticle(id uint32) (Article, error) {
|
|
return g.articleRepository.Get(id)
|
|
}
|