mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
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.
22 lines
416 B
Go
22 lines
416 B
Go
package useCases
|
|
|
|
import (
|
|
"GohCMS2/adapters/secondary/gateways"
|
|
"GohCMS2/domain/post"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type GetPostUseCase struct {
|
|
postRepository gateways.PostRepository
|
|
}
|
|
|
|
func NewGetPostUseCase(db *gorm.DB) *GetPostUseCase {
|
|
return &GetPostUseCase{
|
|
postRepository: *gateways.NewPostRepository(db),
|
|
}
|
|
}
|
|
|
|
func (g *GetPostUseCase) GetPost(id uint32) (post.Post, error) {
|
|
return g.postRepository.Get(id)
|
|
}
|