mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
feat: images
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package useCases
|
||||
|
||||
import (
|
||||
"GoCMS/adapters/secondary/gateways"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type DeleteImageUseCase struct {
|
||||
imageRepository gateways.ImageRepository
|
||||
}
|
||||
|
||||
func NewDeleteImageUseCase(db *gorm.DB) *DeleteImageUseCase {
|
||||
return &DeleteImageUseCase{
|
||||
imageRepository: *gateways.NewImageRepository(db),
|
||||
}
|
||||
}
|
||||
|
||||
func (g *DeleteImageUseCase) DeleteImage(imageId uint32) error {
|
||||
return g.imageRepository.Delete(imageId)
|
||||
}
|
||||
Reference in New Issue
Block a user