mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
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:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user