| | |
| | | "gorm.io/gorm" |
| | | "speechAnalysis/constvar" |
| | | "speechAnalysis/pkg/mysqlx" |
| | | "strings" |
| | | "time" |
| | | ) |
| | | |
| | |
| | | gorm.Model |
| | | Name string `gorm:"index;type:varchar(255);not null;default:'';comment:音频名称" json:"name"` // 音频名称 |
| | | Size int64 `gorm:"type:int;not null;default:0;comment:文件大小" json:"size"` // 音频大小 |
| | | FilePath string `gorm:"type:varchar(255);not null;default:'';comment:音频名称" json:"-"` //音频路径 // 音频路径 |
| | | FilePath string `gorm:"type:varchar(255);not null;default:'';comment:音频路径" json:"-"` //音频路径 // 音频路径 |
| | | AudioStatus constvar.AudioStatus `gorm:"type:tinyint;not null;default:0;comment:状态" json:"audioStatus"` // 音频状态 |
| | | LocomotiveNumber string `gorm:"index;type:varchar(255);not null;default:'';comment:机车号" json:"locomotiveNumber"` // 机车号 |
| | | TrainNumber string `gorm:"index;type:varchar(255);not null;default:'';comment:车次" json:"trainNumber"` // 车次 |
| | |
| | | IsFollowed constvar.BoolType `gorm:"type:tinyint;not null;default:2;comment:是否关注"` //是否关注 1关注 2未关注 |
| | | Score float64 `json:"score"` // 置信度 |
| | | Words []string `json:"words" gorm:"-"` //匹配到的文字数组 |
| | | Tags string `json:"-" gorm:"type:varchar(255);not null;default:'';comment:匹配到的文字,用逗号拼接"` //匹配到的文字 |
| | | AudioText string `json:"audioText" gorm:"-"` //解析出的文本 |
| | | } |
| | | |
| | |
| | | } else { |
| | | slf.OccurrenceTime = slf.OccurrenceAt.Format("2006-01-02 15:04:05") |
| | | } |
| | | if slf.Tags != "" { |
| | | slf.Words = strings.Split(slf.Tags, ",") |
| | | } |
| | | return |
| | | } |
| | | |
| | | func NewAudioSearch() *AudioSearch { |
| | | return &AudioSearch{Orm: mysqlx.GetDB()} |
| | | } |