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 } }