videoplayer/service/videoService.go

36 lines
887 B
Go
Raw Normal View History

package service
import (
"time"
"videoplayer/dao"
)
func GetVideo(id, auth_id int) dao.Video {
return dao.FindVideoByID(id, auth_id)
}
func GetVideoList(auth_id int, start, end string) []dao.Video {
if start == "" {
return dao.FindVideoListsByAuthID(auth_id)
} else {
s, _ := time.Parse("2006-01-02 15:04:05", start)
e, _ := time.Parse("2006-01-02 15:04:05", end)
if s.After(e) {
return []dao.Video{}
}
return dao.FindVideoListByTime(auth_id, start, end)
}
}
func DelayVideo(id, auth_id, day int) {
dao.DelayVideo(id, auth_id, day)
}
func CreateVideo(videoPath, videoName string, cameraID, authID, human, isDelete int, createTime, endTime string, fileSize int) uint {
return dao.CreateVideo(videoPath, videoName, cameraID, authID, human, isDelete, createTime, endTime, fileSize)
}
func DeleteVideo(id, user int) int {
return dao.DeleteVideoByID(id, user)
}