Files
RenewCMS/useCases/ListPosts.go
T

19 lines
371 B
Go

package useCases
import (
"GoCMS/domain/gateways"
"GoCMS/domain/post"
)
type ListPostsUseCase struct {
postRepository gateways.IPostRepository
}
func NewListPostsUseCase(postRepository gateways.IPostRepository) *ListPostsUseCase {
return &ListPostsUseCase{postRepository}
}
func (g *ListPostsUseCase) ListPosts() []post.Post {
return g.postRepository.GetAll()
}