更新带货视频工作流接口和页面

This commit is contained in:
super
2026-07-09 00:27:49 +08:00
parent 0ecf5cd45a
commit aab4ce942c
51 changed files with 4777 additions and 820 deletions
@@ -86,6 +86,7 @@ aiimage:
oss:
region: ${AIIMAGE_OSS_REGION:cn-hangzhou}
endpoint: ${AIIMAGE_OSS_ENDPOINT:oss-cn-hangzhou.aliyuncs.com}
public-endpoint: ${AIIMAGE_OSS_PUBLIC_ENDPOINT:oss-cn-hangzhou.aliyuncs.com}
bucket: ${AIIMAGE_OSS_BUCKET:nanri-ai-images}
access-key-id: ${AIIMAGE_OSS_ACCESS_KEY_ID:LTAI5tNpyvzMNz9f2dHarsm8}
access-key-secret: ${AIIMAGE_OSS_ACCESS_KEY_SECRET:bQSZnFH455i8tzyOgeahJmUzwmhynz}
@@ -229,6 +230,12 @@ aiimage:
coze-include-legacy-api-key: ${AIIMAGE_SIMILAR_ASIN_COZE_INCLUDE_LEGACY_API_KEY:true}
coze-use-legacy-item-field-order: ${AIIMAGE_SIMILAR_ASIN_COZE_USE_LEGACY_ITEM_ORDER:false}
coze-result-buffer-enabled: ${AIIMAGE_SIMILAR_ASIN_COZE_RESULT_BUFFER_ENABLED:true}
image-video:
coze-base-url: ${AIIMAGE_IMAGE_VIDEO_COZE_BASE_URL:https://api.coze.cn}
coze-token: ${AIIMAGE_IMAGE_VIDEO_COZE_TOKEN:}
coze-workflow-path: ${AIIMAGE_IMAGE_VIDEO_COZE_WORKFLOW_PATH:/v1/workflow/run}
coze-connect-timeout-millis: ${AIIMAGE_IMAGE_VIDEO_COZE_CONNECT_TIMEOUT_MILLIS:10000}
coze-read-timeout-millis: ${AIIMAGE_IMAGE_VIDEO_COZE_READ_TIMEOUT_MILLIS:600000}
security:
shop-credential-key: ${AIIMAGE_SHOP_CREDENTIAL_KEY:change-me-shop-credential-key}
internal-token: ${AIIMAGE_INTERNAL_TOKEN:}
@@ -67,7 +67,7 @@ SELECT
JSON_ARRAY('ASIN', '价格'),
JSON_ARRAY('sku', 'price', 'quantity', 'product-id', 'product-id-type', 'condition-type', 'condition-note', 'ASIN-hint', 'title', 'product-tax-code', 'operation-type', 'sale-price', 'sale-start-date', 'sale-end-date', 'leadtime-to-ship', 'launch-date', 'is-giftwrap-available', 'is-gift-message-available'),
JSON_OBJECT('price', '价格', 'product-id', 'ASIN'),
JSON_OBJECT('quantity', '100', 'product-id-type', 'ASIN', 'condition-type', 'new', 'leadtime-to-ship', '4'),
JSON_OBJECT('quantity', '100', 'product-id-type', 'ASIN', 'condition-type', 'new', 'leadtime-to-ship', '5'),
JSON_ARRAY('TemplateType=Offer\tVersion=1.4'),
1,
1, 1, 1
@@ -6,7 +6,7 @@ SET required_source_columns_json = JSON_ARRAY('ASIN', '价格'),
'sale-end-date', 'leadtime-to-ship', 'launch-date', 'is-giftwrap-available', 'is-gift-message-available'
),
field_mapping_json = JSON_OBJECT('price', '价格', 'product-id', 'ASIN'),
defaults_json = JSON_OBJECT('quantity', '100', 'product-id-type', 'ASIN', 'condition-type', 'new', 'leadtime-to-ship', '4'),
defaults_json = JSON_OBJECT('quantity', '100', 'product-id-type', 'ASIN', 'condition-type', 'new', 'leadtime-to-ship', '5'),
preamble_lines_json = JSON_ARRAY('TemplateType=Offer\tVersion=1.4'),
blank_header_rows_after_schema = 1,
output_filename = '英国.txt',
@@ -0,0 +1,13 @@
CREATE TABLE `biz_image_video_secret` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`user_id` BIGINT NOT NULL COMMENT '用户ID',
`copy_api_key` VARCHAR(1024) NOT NULL COMMENT '文案工作流 api_key,加密存储',
`voice_api_key` VARCHAR(1024) NOT NULL COMMENT '音色工作流 api_key,加密存储',
`voice_group_id` VARCHAR(512) NOT NULL COMMENT '音色 group_id,加密存储',
`expires_at` DATETIME NOT NULL COMMENT '过期时间',
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_user_id` (`user_id`),
KEY `idx_expires_at` (`expires_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='视频复刻/图生视频用户密钥配置';
@@ -0,0 +1,2 @@
ALTER TABLE `biz_image_video_secret`
ADD COLUMN `coze_token` VARCHAR(1024) NULL COMMENT 'Encrypted Coze Bearer token' AFTER `user_id`;
@@ -0,0 +1,2 @@
ALTER TABLE `biz_image_video_secret`
ADD COLUMN `t8_key` VARCHAR(1024) NULL COMMENT 'Encrypted rewrite workflow t8_key' AFTER `copy_api_key`;
@@ -0,0 +1,15 @@
ALTER TABLE `biz_image_video_secret`
ADD COLUMN `douyin_copy_workflow_id` VARCHAR(128) NULL COMMENT 'Douyin copy workflow id' AFTER `voice_group_id`,
ADD COLUMN `image_video_workflow_id` VARCHAR(128) NULL COMMENT 'Image/video generation workflow id' AFTER `douyin_copy_workflow_id`,
ADD COLUMN `voice_delete_workflow_id` VARCHAR(128) NULL COMMENT 'Voice delete workflow id' AFTER `image_video_workflow_id`,
ADD COLUMN `voice_list_workflow_id` VARCHAR(128) NULL COMMENT 'Voice list workflow id' AFTER `voice_delete_workflow_id`,
ADD COLUMN `voice_clone_workflow_id` VARCHAR(128) NULL COMMENT 'Voice clone workflow id' AFTER `voice_list_workflow_id`,
ADD COLUMN `voice_synthesis_workflow_id` VARCHAR(128) NULL COMMENT 'Voice synthesis workflow id' AFTER `voice_clone_workflow_id`;
UPDATE `biz_image_video_secret`
SET `douyin_copy_workflow_id` = COALESCE(NULLIF(`douyin_copy_workflow_id`, ''), '7658723854722383907'),
`image_video_workflow_id` = COALESCE(NULLIF(`image_video_workflow_id`, ''), '7657925338589544457'),
`voice_delete_workflow_id` = COALESCE(NULLIF(`voice_delete_workflow_id`, ''), '7652954386453299243'),
`voice_list_workflow_id` = COALESCE(NULLIF(`voice_list_workflow_id`, ''), '7652954332346089498'),
`voice_clone_workflow_id` = COALESCE(NULLIF(`voice_clone_workflow_id`, ''), '7652954356887961641'),
`voice_synthesis_workflow_id` = COALESCE(NULLIF(`voice_synthesis_workflow_id`, ''), '7652954297530105894');
@@ -0,0 +1,85 @@
CREATE TABLE IF NOT EXISTS `biz_image_video_workflow_config` (
`config_key` VARCHAR(64) NOT NULL COMMENT 'Workflow config key',
`workflow_id` VARCHAR(128) NOT NULL COMMENT 'Coze workflow id',
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`config_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Image video public workflow config';
INSERT INTO `biz_image_video_workflow_config` (`config_key`, `workflow_id`)
VALUES
('douyin_copy', '7658723854722383907'),
('image_video', '7659086169628377124'),
('voice_delete', '7652954386453299243'),
('voice_list', '7652954332346089498'),
('voice_clone', '7652954356887961641'),
('voice_synthesis', '7652954297530105894')
ON DUPLICATE KEY UPDATE
`workflow_id` = VALUES(`workflow_id`),
`updated_at` = CURRENT_TIMESTAMP;
SET @sql_drop_douyin_copy_workflow_id = (
SELECT IF(COUNT(*) > 0, 'ALTER TABLE `biz_image_video_secret` DROP COLUMN `douyin_copy_workflow_id`', 'SELECT 1')
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'biz_image_video_secret'
AND COLUMN_NAME = 'douyin_copy_workflow_id'
);
PREPARE stmt_drop_douyin_copy_workflow_id FROM @sql_drop_douyin_copy_workflow_id;
EXECUTE stmt_drop_douyin_copy_workflow_id;
DEALLOCATE PREPARE stmt_drop_douyin_copy_workflow_id;
SET @sql_drop_image_video_workflow_id = (
SELECT IF(COUNT(*) > 0, 'ALTER TABLE `biz_image_video_secret` DROP COLUMN `image_video_workflow_id`', 'SELECT 1')
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'biz_image_video_secret'
AND COLUMN_NAME = 'image_video_workflow_id'
);
PREPARE stmt_drop_image_video_workflow_id FROM @sql_drop_image_video_workflow_id;
EXECUTE stmt_drop_image_video_workflow_id;
DEALLOCATE PREPARE stmt_drop_image_video_workflow_id;
SET @sql_drop_voice_delete_workflow_id = (
SELECT IF(COUNT(*) > 0, 'ALTER TABLE `biz_image_video_secret` DROP COLUMN `voice_delete_workflow_id`', 'SELECT 1')
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'biz_image_video_secret'
AND COLUMN_NAME = 'voice_delete_workflow_id'
);
PREPARE stmt_drop_voice_delete_workflow_id FROM @sql_drop_voice_delete_workflow_id;
EXECUTE stmt_drop_voice_delete_workflow_id;
DEALLOCATE PREPARE stmt_drop_voice_delete_workflow_id;
SET @sql_drop_voice_list_workflow_id = (
SELECT IF(COUNT(*) > 0, 'ALTER TABLE `biz_image_video_secret` DROP COLUMN `voice_list_workflow_id`', 'SELECT 1')
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'biz_image_video_secret'
AND COLUMN_NAME = 'voice_list_workflow_id'
);
PREPARE stmt_drop_voice_list_workflow_id FROM @sql_drop_voice_list_workflow_id;
EXECUTE stmt_drop_voice_list_workflow_id;
DEALLOCATE PREPARE stmt_drop_voice_list_workflow_id;
SET @sql_drop_voice_clone_workflow_id = (
SELECT IF(COUNT(*) > 0, 'ALTER TABLE `biz_image_video_secret` DROP COLUMN `voice_clone_workflow_id`', 'SELECT 1')
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'biz_image_video_secret'
AND COLUMN_NAME = 'voice_clone_workflow_id'
);
PREPARE stmt_drop_voice_clone_workflow_id FROM @sql_drop_voice_clone_workflow_id;
EXECUTE stmt_drop_voice_clone_workflow_id;
DEALLOCATE PREPARE stmt_drop_voice_clone_workflow_id;
SET @sql_drop_voice_synthesis_workflow_id = (
SELECT IF(COUNT(*) > 0, 'ALTER TABLE `biz_image_video_secret` DROP COLUMN `voice_synthesis_workflow_id`', 'SELECT 1')
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'biz_image_video_secret'
AND COLUMN_NAME = 'voice_synthesis_workflow_id'
);
PREPARE stmt_drop_voice_synthesis_workflow_id FROM @sql_drop_voice_synthesis_workflow_id;
EXECUTE stmt_drop_voice_synthesis_workflow_id;
DEALLOCATE PREPARE stmt_drop_voice_synthesis_workflow_id;
@@ -0,0 +1,5 @@
INSERT INTO `biz_image_video_workflow_config` (`config_key`, `workflow_id`)
VALUES ('douyin_copy', '7652941112982798388')
ON DUPLICATE KEY UPDATE
`workflow_id` = VALUES(`workflow_id`),
`updated_at` = CURRENT_TIMESTAMP;
@@ -0,0 +1,5 @@
INSERT INTO `biz_image_video_workflow_config` (`config_key`, `workflow_id`)
VALUES ('image_video', '7659086169628377124')
ON DUPLICATE KEY UPDATE
`workflow_id` = VALUES(`workflow_id`),
`updated_at` = CURRENT_TIMESTAMP;
@@ -0,0 +1,9 @@
UPDATE biz_convert_template
SET defaults_json = JSON_SET(
COALESCE(defaults_json, JSON_OBJECT()),
'$."leadtime-to-ship"',
'5'
),
updated_at = NOW()
WHERE JSON_CONTAINS_PATH(defaults_json, 'one', '$."leadtime-to-ship"')
OR JSON_CONTAINS(header_columns_json, JSON_QUOTE('leadtime-to-ship'));
@@ -44,11 +44,11 @@ CREATE TABLE `biz_convert_template` (
-- ----------------------------
-- Records of biz_convert_template
-- ----------------------------
INSERT INTO `biz_convert_template` VALUES (1, 'uk_offer', '五国模板', '英国.txt、法国.txt、德国.txt、西班牙.txt、意大利.txt', '[\"ASIN\", \"价格\"]', '[\"sku\", \"price\", \"quantity\", \"product-id\", \"product-id-type\", \"condition-type\", \"condition-note\", \"ASIN-hint\", \"title\", \"product-tax-code\", \"operation-type\", \"sale-price\", \"sale-start-date\", \"sale-end-date\", \"leadtime-to-ship\", \"launch-date\", \"is-giftwrap-available\", \"is-gift-message-available\"]', '{\"price\": \"价格\", \"product-id\": \"ASIN\"}', '{\"quantity\": \"100\", \"condition-type\": \"new\", \"product-id-type\": \"ASIN\", \"leadtime-to-ship\": \"4\"}', '[\"TemplateType=Offer\\tVersion=1.4\"]', 1, 1, 1, 1, '2026-03-20 12:47:10', '2026-03-22 02:02:20');
INSERT INTO `biz_convert_template` VALUES (2, 'user_1773982693758', '测试', '测试.txt', '[\"ASIN\", \"价格\"]', '[\"sku\", \"price\", \"quantity\", \"product-id\", \"product-id-type\", \"condition-type\", \"condition-note\", \"ASIN-hint\", \"title\", \"product-tax-code\", \"operation-type\", \"sale-price\", \"sale-start-date\", \"sale-end-date\", \"leadtime-to-ship\", \"launch-date\", \"is-giftwrap-available\", \"is-gift-message-available\"]', '{\"price\": \"价格\", \"product-id\": \"ASIN\"}', '{\"quantity\": \"100\", \"condition-type\": \"new\", \"product-id-type\": \"ASIN\", \"leadtime-to-ship\": \"4\"}', '[\"TemplateType=Offer\\tVersion=1.4\"]', 1, 1, 0, 0, '2026-03-20 12:58:14', '2026-03-20 13:11:11');
INSERT INTO `biz_convert_template` VALUES (3, 'user_1773983523504', '英国', '英国.txt', '[\"ASIN\", \"价格\"]', '[\"sku\", \"price\", \"quantity\", \"product-id\", \"product-id-type\", \"condition-type\", \"condition-note\", \"ASIN-hint\", \"title\", \"product-tax-code\", \"operation-type\", \"sale-price\", \"sale-start-date\", \"sale-end-date\", \"leadtime-to-ship\", \"launch-date\", \"is-giftwrap-available\", \"is-gift-message-available\"]', '{\"price\": \"价格\", \"product-id\": \"ASIN\"}', '{\"quantity\": \"100\", \"condition-type\": \"new\", \"product-id-type\": \"ASIN\", \"leadtime-to-ship\": \"4\"}', '[\"TemplateType=Offer\\tVersion=1.4\"]', 1, 0, 0, 0, '2026-03-20 13:12:04', '2026-03-20 13:48:59');
INSERT INTO `biz_convert_template` VALUES (4, 'user_1774113164444', '英国', '英国.txt', '[\"ASIN\", \"价格\"]', '[\"sku\", \"price\", \"quantity\", \"product-id\", \"product-id-type\", \"condition-type\", \"condition-note\", \"ASIN-hint\", \"title\", \"product-tax-code\", \"operation-type\", \"sale-price\", \"sale-start-date\", \"sale-end-date\", \"leadtime-to-ship\", \"launch-date\", \"is-giftwrap-available\", \"is-gift-message-available\"]', '{\"price\": \"价格\", \"product-id\": \"ASIN\"}', '{\"quantity\": \"100\", \"condition-type\": \"new\", \"product-id-type\": \"ASIN\", \"leadtime-to-ship\": \"4\"}', '[\"TemplateType=Offer\\tVersion=1.4\"]', 1, 0, 0, 0, '2026-03-22 01:12:44', '2026-03-22 01:14:37');
INSERT INTO `biz_convert_template` VALUES (5, 'user_1774113261643', '英国', '英国.txt', '[\"ASIN\", \"价格\"]', '[\"sku\", \"price\", \"quantity\", \"product-id\", \"product-id-type\", \"condition-type\", \"condition-note\", \"ASIN-hint\", \"title\", \"product-tax-code\", \"operation-type\", \"sale-price\", \"sale-start-date\", \"sale-end-date\", \"leadtime-to-ship\", \"launch-date\", \"is-giftwrap-available\", \"is-gift-message-available\"]', '{\"price\": \"价格\", \"product-id\": \"ASIN\"}', '{\"quantity\": \"100\", \"condition-type\": \"new\", \"product-id-type\": \"ASIN\", \"leadtime-to-ship\": \"4\"}', '[\"TemplateType=Offer\\tVersion=1.4\"]', 1, 1, 0, 0, '2026-03-22 01:14:22', '2026-03-22 01:14:33');
INSERT INTO `biz_convert_template` VALUES (1, 'uk_offer', '五国模板', '英国.txt、法国.txt、德国.txt、西班牙.txt、意大利.txt', '[\"ASIN\", \"价格\"]', '[\"sku\", \"price\", \"quantity\", \"product-id\", \"product-id-type\", \"condition-type\", \"condition-note\", \"ASIN-hint\", \"title\", \"product-tax-code\", \"operation-type\", \"sale-price\", \"sale-start-date\", \"sale-end-date\", \"leadtime-to-ship\", \"launch-date\", \"is-giftwrap-available\", \"is-gift-message-available\"]', '{\"price\": \"价格\", \"product-id\": \"ASIN\"}', '{\"quantity\": \"100\", \"condition-type\": \"new\", \"product-id-type\": \"ASIN\", \"leadtime-to-ship\": \"5\"}', '[\"TemplateType=Offer\\tVersion=1.4\"]', 1, 1, 1, 1, '2026-03-20 12:47:10', '2026-03-22 02:02:20');
INSERT INTO `biz_convert_template` VALUES (2, 'user_1773982693758', '测试', '测试.txt', '[\"ASIN\", \"价格\"]', '[\"sku\", \"price\", \"quantity\", \"product-id\", \"product-id-type\", \"condition-type\", \"condition-note\", \"ASIN-hint\", \"title\", \"product-tax-code\", \"operation-type\", \"sale-price\", \"sale-start-date\", \"sale-end-date\", \"leadtime-to-ship\", \"launch-date\", \"is-giftwrap-available\", \"is-gift-message-available\"]', '{\"price\": \"价格\", \"product-id\": \"ASIN\"}', '{\"quantity\": \"100\", \"condition-type\": \"new\", \"product-id-type\": \"ASIN\", \"leadtime-to-ship\": \"5\"}', '[\"TemplateType=Offer\\tVersion=1.4\"]', 1, 1, 0, 0, '2026-03-20 12:58:14', '2026-03-20 13:11:11');
INSERT INTO `biz_convert_template` VALUES (3, 'user_1773983523504', '英国', '英国.txt', '[\"ASIN\", \"价格\"]', '[\"sku\", \"price\", \"quantity\", \"product-id\", \"product-id-type\", \"condition-type\", \"condition-note\", \"ASIN-hint\", \"title\", \"product-tax-code\", \"operation-type\", \"sale-price\", \"sale-start-date\", \"sale-end-date\", \"leadtime-to-ship\", \"launch-date\", \"is-giftwrap-available\", \"is-gift-message-available\"]', '{\"price\": \"价格\", \"product-id\": \"ASIN\"}', '{\"quantity\": \"100\", \"condition-type\": \"new\", \"product-id-type\": \"ASIN\", \"leadtime-to-ship\": \"5\"}', '[\"TemplateType=Offer\\tVersion=1.4\"]', 1, 0, 0, 0, '2026-03-20 13:12:04', '2026-03-20 13:48:59');
INSERT INTO `biz_convert_template` VALUES (4, 'user_1774113164444', '英国', '英国.txt', '[\"ASIN\", \"价格\"]', '[\"sku\", \"price\", \"quantity\", \"product-id\", \"product-id-type\", \"condition-type\", \"condition-note\", \"ASIN-hint\", \"title\", \"product-tax-code\", \"operation-type\", \"sale-price\", \"sale-start-date\", \"sale-end-date\", \"leadtime-to-ship\", \"launch-date\", \"is-giftwrap-available\", \"is-gift-message-available\"]', '{\"price\": \"价格\", \"product-id\": \"ASIN\"}', '{\"quantity\": \"100\", \"condition-type\": \"new\", \"product-id-type\": \"ASIN\", \"leadtime-to-ship\": \"5\"}', '[\"TemplateType=Offer\\tVersion=1.4\"]', 1, 0, 0, 0, '2026-03-22 01:12:44', '2026-03-22 01:14:37');
INSERT INTO `biz_convert_template` VALUES (5, 'user_1774113261643', '英国', '英国.txt', '[\"ASIN\", \"价格\"]', '[\"sku\", \"price\", \"quantity\", \"product-id\", \"product-id-type\", \"condition-type\", \"condition-note\", \"ASIN-hint\", \"title\", \"product-tax-code\", \"operation-type\", \"sale-price\", \"sale-start-date\", \"sale-end-date\", \"leadtime-to-ship\", \"launch-date\", \"is-giftwrap-available\", \"is-gift-message-available\"]', '{\"price\": \"价格\", \"product-id\": \"ASIN\"}', '{\"quantity\": \"100\", \"condition-type\": \"new\", \"product-id-type\": \"ASIN\", \"leadtime-to-ship\": \"5\"}', '[\"TemplateType=Offer\\tVersion=1.4\"]', 1, 1, 0, 0, '2026-03-22 01:14:22', '2026-03-22 01:14:33');
-- ----------------------------
-- Table structure for biz_dedupe_total_data