feat(server): 添加图片生成服务和配置更新

This commit is contained in:
2026-03-13 22:20:10 +08:00
parent 5f94129236
commit c850623a48
5 changed files with 149 additions and 19 deletions

View File

@@ -163,23 +163,7 @@ CREATE TABLE IF NOT EXISTS `story_drafts` (
-- ============================================
-- 8. 游玩记录表
-- ============================================
CREATE TABLE IF NOT EXISTS `play_records` (
`id` INT NOT NULL AUTO_INCREMENT,
`user_id` INT NOT NULL COMMENT '用户ID',
`story_id` INT NOT NULL COMMENT '故事ID',
`draft_id` INT DEFAULT NULL COMMENT 'AI草稿ID原故事为空',
`ending_name` VARCHAR(100) NOT NULL COMMENT '结局名称',
`ending_type` VARCHAR(20) DEFAULT '' COMMENT '结局类型',
`path_history` JSON NOT NULL COMMENT '完整的选择路径',
`play_duration` INT DEFAULT 0 COMMENT '游玩时长(秒)',
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_user_story` (`user_id`, `story_id`),
KEY `idx_user` (`user_id`),
KEY `idx_story` (`story_id`),
CONSTRAINT `play_records_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
CONSTRAINT `play_records_ibfk_2` FOREIGN KEY (`story_id`) REFERENCES `stories` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='游玩记录表';
c
-- ============================================
-- 9. 故事角色表