owl-blogs/app/binary_service.go

23 lines
490 B
Go
Raw Normal View History

2023-07-08 09:08:55 +00:00
package app
import (
"owl-blogs/app/repository"
"owl-blogs/domain/model"
)
type BinaryService struct {
repo repository.BinaryRepository
}
func NewBinaryFileService(repo repository.BinaryRepository) *BinaryService {
return &BinaryService{repo: repo}
}
func (s *BinaryService) Create(name string, file []byte) (*model.BinaryFile, error) {
2023-07-09 19:27:59 +00:00
return s.repo.Create(name, file, nil)
2023-07-08 09:08:55 +00:00
}
func (s *BinaryService) FindById(id string) (*model.BinaryFile, error) {
return s.repo.FindById(id)
}