修复视频搜索日期错误仍搜索问题

This commit is contained in:
junleea 2024-07-03 17:52:32 +08:00
parent 75a0cb9f3c
commit 7c78231d91
1 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package service
import (
"fmt"
"strings"
"time"
"videoplayer/dao"
"videoplayer/proto"
)
@ -47,7 +48,11 @@ func GetVideoList(auth_id int, start, end, hour string) []dao.Video {
es1 := strings.Split(es[1], ":")
end = es[0] + " " + hour + ":" + es1[1] + ":" + es1[2]
}
_, err := time.Parse("2006-01-02 15:04:05", start)
_, err2 := time.Parse("2006-01-02 15:04:05", end)
if err != nil || err2 != nil {
return []dao.Video{}
}
return dao.FindVideoListByTime(auth_id, start, end)
}
}