-
Notifications
You must be signed in to change notification settings - Fork 0
/
video-service.go
42 lines (34 loc) · 889 Bytes
/
video-service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package service
import (
"github.com/dalecosta1/sinaloa-api/entity"
"github.com/dalecosta1/sinaloa-api/repository"
)
type VideoService interface {
Save(entity.Video) error
Update(entity.Video) error
Delete(entity.Video) error
FindAll() []entity.Video
}
type videoService struct {
repository repository.VideoRepository
}
func New(videoRepository repository.VideoRepository) VideoService {
return &videoService{
repository: videoRepository,
}
}
func (service *videoService) Save(video entity.Video) error {
service.repository.Save(video)
return nil
}
func (service *videoService) Update(video entity.Video) error {
service.repository.Update(video)
return nil
}
func (service *videoService) Delete(video entity.Video) error {
service.repository.Delete(video)
return nil
}
func (service *videoService) FindAll() []entity.Video {
return service.repository.FindAll()
}