blog/backend/internal/application/get_all_posts_use_case.go
SquidSpirit a4394eea9e
All checks were successful
Frontend CI / build (push) Successful in 1m56s
BLOG-43 feat: get all posts
2025-03-28 00:02:34 +08:00

22 lines
452 B
Go

package application
import "git.squidspirit.com/squid/blog.git/backend/internal/domain"
type GetAllPostsUseCase interface {
Execute() ([]*domain.Post, error)
}
type getAllPostsUseCaseImpl struct {
postRepo PostRepo
}
func NewGetAllPostsUseCase(postRepo PostRepo) GetAllPostsUseCase {
return &getAllPostsUseCaseImpl{
postRepo: postRepo,
}
}
func (uc *getAllPostsUseCaseImpl) Execute() ([]*domain.Post, error) {
return uc.postRepo.GetAll()
}