mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
21 lines
420 B
Go
21 lines
420 B
Go
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)
|
|
}
|