clean: Article to Post in domain and related use cases

Renamed the 'Article' domain to 'Post' in order to better reflect the purpose and utility of the object. The change involved renaming all related use cases, classes, and other references from 'Article' to 'Post' and updating all functions and data types to work with Posts instead of Articles.
This commit is contained in:
Florian Sylvain
2023-09-06 01:56:27 +02:00
parent 46491a688b
commit 554fdc1989
18 changed files with 274 additions and 271 deletions
+21
View File
@@ -0,0 +1,21 @@
package useCases
import (
"GohCMS2/adapters/secondary/gateways"
"GohCMS2/domain/post"
"gorm.io/gorm"
)
type GetArticleUseCase struct {
articleRepository gateways.PostRepository
}
func NewGetArticleUseCase(db *gorm.DB) *GetArticleUseCase {
return &GetArticleUseCase{
articleRepository: *gateways.NewPostRepository(db),
}
}
func (g *GetArticleUseCase) GetArticle(id uint32) (post.Post, error) {
return g.articleRepository.Get(id)
}