mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
22 lines
409 B
Go
22 lines
409 B
Go
package useCases
|
|
|
|
import (
|
|
"GoCMS/adapters/secondary/gateways"
|
|
"GoCMS/domain/post"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type ListPostsUseCase struct {
|
|
postRepository gateways.PostRepository
|
|
}
|
|
|
|
func NewListPostsUseCase(db *gorm.DB) *ListPostsUseCase {
|
|
return &ListPostsUseCase{
|
|
postRepository: *gateways.NewPostRepository(db),
|
|
}
|
|
}
|
|
|
|
func (g *ListPostsUseCase) ListPosts() []post.Post {
|
|
return g.postRepository.GetAll()
|
|
}
|