You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
490 B
23 lines
490 B
package service
|
|
|
|
import (
|
|
"errors"
|
|
"main_program/common"
|
|
"main_program/entity"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type srtFileService struct{}
|
|
|
|
var SrtFileService srtFileService
|
|
|
|
func (srt *srtFileService) QueryOneNotScanVideoId() (videoId string, err error) {
|
|
var srtFile entity.Srtfile
|
|
result := common.MysqlDB.Where(&entity.Srtfile{IsScan: 0}).First(&srtFile)
|
|
if errors.Is(result.Error, gorm.ErrRecordNotFound) {
|
|
return "", errors.New("no srtFile")
|
|
} else {
|
|
return srtFile.VideoId, nil
|
|
}
|
|
}
|
|
|