49b709df9f
- 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.
50 lines
2.2 KiB
SQL
50 lines
2.2 KiB
SQL
-- 短视频去水印调用日志
|
|
CREATE TABLE IF NOT EXISTS `video_parse_logs` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
`deleted_at` datetime DEFAULT NULL,
|
|
`mini_program_id` bigint unsigned NOT NULL,
|
|
`user_id` bigint unsigned NOT NULL,
|
|
`request_content` text,
|
|
`parsed_url` varchar(500) DEFAULT NULL,
|
|
`third_party_status` int DEFAULT NULL,
|
|
`third_party_payload` json DEFAULT NULL,
|
|
`free_quota_used` tinyint(1) NOT NULL DEFAULT '1',
|
|
`duration_ms` int DEFAULT NULL,
|
|
`error_message` varchar(500) DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `idx_video_parse_user_date` (`mini_program_id`,`user_id`,`created_at`),
|
|
KEY `idx_video_parse_free` (`mini_program_id`,`user_id`,`free_quota_used`,`created_at`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
-- 每日广告解锁记录
|
|
CREATE TABLE IF NOT EXISTS `video_parse_unlocks` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
`deleted_at` datetime DEFAULT NULL,
|
|
`mini_program_id` bigint unsigned NOT NULL,
|
|
`user_id` bigint unsigned NOT NULL,
|
|
`unlock_date` date NOT NULL,
|
|
`ad_watched_at` datetime NOT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `uniq_video_unlock_date` (`mini_program_id`,`user_id`,`unlock_date`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
-- 下载失败上报
|
|
CREATE TABLE IF NOT EXISTS `video_download_failures` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
`deleted_at` datetime DEFAULT NULL,
|
|
`domain` varchar(255) DEFAULT NULL,
|
|
`failed_url` varchar(1000) NOT NULL,
|
|
`error_message` text,
|
|
`reported_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
`user_agent` varchar(255) DEFAULT NULL,
|
|
`client_ip` varchar(64) DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `idx_video_download_domain` (`domain`,`reported_at`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|