Add video download failure reporting feature
- Introduced a new API endpoint `POST /api/v1/video/remove_watermark/report_failure` for reporting download failures. - Added a new database table `video_download_failures` to store details about failed downloads, including domain, URL, error message, and reporting metadata. - Updated the video handler to process failure reports and save them to the database. - Enhanced documentation to include details about the new reporting feature and its usage.
This commit is contained in:
@@ -50,3 +50,25 @@ func (VideoParseUnlock) TableName() string {
|
||||
func (VideoParseUnlock) TableComment() string {
|
||||
return "短视频去水印-每日广告解锁"
|
||||
}
|
||||
|
||||
type VideoDownloadFailure struct {
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
CreatedAt time.Time `gorm:"comment:创建时间" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"comment:更新时间" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index;comment:删除时间" json:"-"`
|
||||
|
||||
Domain string `gorm:"size:255;index;comment:来源域名" json:"domain"`
|
||||
FailedURL string `gorm:"size:1000;comment:下载失败的URL" json:"failed_url"`
|
||||
ErrorMessage string `gorm:"type:text;comment:失败原因" json:"error_message"`
|
||||
ReportedAt time.Time `gorm:"index;comment:失败发生时间" json:"reported_at"`
|
||||
UserAgent string `gorm:"size:255;comment:上报端UA" json:"user_agent"`
|
||||
ClientIP string `gorm:"size:64;comment:上报IP" json:"client_ip"`
|
||||
}
|
||||
|
||||
func (VideoDownloadFailure) TableName() string {
|
||||
return "video_download_failures"
|
||||
}
|
||||
|
||||
func (VideoDownloadFailure) TableComment() string {
|
||||
return "短视频去水印-下载失败上报"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user