mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
fix: all remaining "article" replaced by "post"
All instances of the term "article" were replaced with "post" in variable names, type names, function names, etc. This was primarily to ensure consistent naming and reduce confusion going forward. The term "post" was chosen as it's a more commonly used term for the involved operations in the context of content management and blogging platforms. All tests were also updated to reflect these changes.
This commit is contained in:
@@ -6,16 +6,16 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type GetArticleUseCase struct {
|
||||
articleRepository gateways.PostRepository
|
||||
type GetPostUseCase struct {
|
||||
postRepository gateways.PostRepository
|
||||
}
|
||||
|
||||
func NewGetArticleUseCase(db *gorm.DB) *GetArticleUseCase {
|
||||
return &GetArticleUseCase{
|
||||
articleRepository: *gateways.NewPostRepository(db),
|
||||
func NewGetPostUseCase(db *gorm.DB) *GetPostUseCase {
|
||||
return &GetPostUseCase{
|
||||
postRepository: *gateways.NewPostRepository(db),
|
||||
}
|
||||
}
|
||||
|
||||
func (g *GetArticleUseCase) GetArticle(id uint32) (post.Post, error) {
|
||||
return g.articleRepository.Get(id)
|
||||
func (g *GetPostUseCase) GetPost(id uint32) (post.Post, error) {
|
||||
return g.postRepository.Get(id)
|
||||
}
|
||||
|
||||
@@ -6,16 +6,16 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type ListArticlesUseCase struct {
|
||||
articleRepository gateways.PostRepository
|
||||
type ListPostsUseCase struct {
|
||||
postRepository gateways.PostRepository
|
||||
}
|
||||
|
||||
func NewListArticlesUseCase(db *gorm.DB) *ListArticlesUseCase {
|
||||
return &ListArticlesUseCase{
|
||||
articleRepository: *gateways.NewPostRepository(db),
|
||||
func NewListPostsUseCase(db *gorm.DB) *ListPostsUseCase {
|
||||
return &ListPostsUseCase{
|
||||
postRepository: *gateways.NewPostRepository(db),
|
||||
}
|
||||
}
|
||||
|
||||
func (g *ListArticlesUseCase) ListArticles() []post.Post {
|
||||
return g.articleRepository.GetAll()
|
||||
func (g *ListPostsUseCase) ListPosts() []post.Post {
|
||||
return g.postRepository.GetAll()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user