mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
refac: fixed, better, smarter, correct dependency injection
This commit is contained in:
@@ -1,18 +1,15 @@
|
||||
package useCases
|
||||
|
||||
import (
|
||||
"GoCMS/adapters/secondary/gateways"
|
||||
"gorm.io/gorm"
|
||||
"GoCMS/domain/gateways"
|
||||
)
|
||||
|
||||
type DeletePostUseCase struct {
|
||||
postRepository gateways.PostRepository
|
||||
postRepository gateways.IPostRepository
|
||||
}
|
||||
|
||||
func NewDeletePostUseCase(db *gorm.DB) *DeletePostUseCase {
|
||||
return &DeletePostUseCase{
|
||||
postRepository: *gateways.NewPostRepository(db),
|
||||
}
|
||||
func NewDeletePostUseCase(postRepository gateways.IPostRepository) *DeletePostUseCase {
|
||||
return &DeletePostUseCase{postRepository}
|
||||
}
|
||||
|
||||
func (g *DeletePostUseCase) DeletePost(userId uint32) error {
|
||||
|
||||
Reference in New Issue
Block a user