feat: images

This commit is contained in:
Florian Sylvain
2024-06-13 13:34:10 +02:00
parent eb98a1003e
commit c25fb1b0a3
19 changed files with 387 additions and 100 deletions
+22
View File
@@ -0,0 +1,22 @@
package useCases
import (
"GoCMS/adapters/secondary/gateways"
"GoCMS/domain/image"
"gorm.io/gorm"
"mime/multipart"
)
type CreateImageUseCase struct {
imageRepository gateways.ImageRepository
}
func NewCreateImageUseCase(db *gorm.DB) *CreateImageUseCase {
return &CreateImageUseCase{
imageRepository: *gateways.NewImageRepository(db),
}
}
func (g *CreateImageUseCase) CreateImage(file multipart.File, fileHeader multipart.FileHeader) (image.Image, error) {
return g.imageRepository.Create(file, fileHeader)
}