mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
refac: separated api content into sub-packages & renamed usecases
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user