feat: post deletion
This commit is contained in:
1 parent
c1317e9f21
commit
7d2795a9e0
8 files changed
+107
-4
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package useCases
|
||||
|
||||
import (
|
||||
"GoCMS/adapters/secondary/gateways"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type DeletePostUseCase struct {
|
||||
postRepository gateways.PostRepository
|
||||
}
|
||||
|
||||
func NewDeletePostUseCase(db *gorm.DB) *DeletePostUseCase {
|
||||
return &DeletePostUseCase{
|
||||
postRepository: *gateways.NewPostRepository(db),
|
||||
}
|
||||
}
|
||||
|
||||
func (g *DeletePostUseCase) DeletePost(userId uint32) error {
|
||||
return g.postRepository.Delete(userId)
|
||||
}
|
||||
Reference in new issue
Block a user