feat: AI改写功能集成角色数据 + UI优化

- 新增story_characters表和seed_characters.sql种子数据(27个角色)
- AI改写/续写功能注入角色信息(性别/年龄/外貌/性格)
- 首页UI下移避让微信退出按钮
- 个人中心页面布局重构
This commit is contained in:
2026-03-11 18:41:56 +08:00
parent 2470cea7e4
commit 4ac47c8474
8 changed files with 478 additions and 47 deletions

View File

@@ -0,0 +1,209 @@
-- 角色种子数据
USE stardom_story;
-- ============================================
-- 故事1: 总裁的替身新娘
-- ============================================
INSERT INTO story_characters (id, story_id, name, role_type, gender, age_range, appearance, personality, avatar_prompt) VALUES
(1, 1, '林诗语', 'protagonist', 'female', 'young', '清秀温婉的面容,一双明亮的杏眼,乌黑长发及腰,身材纤细,气质如兰', '善良隐忍,聪慧坚韧,温柔但有底线', 'young chinese woman, gentle beauty, long black hair, bright almond eyes, slender figure, elegant temperament, wedding dress'),
(2, 1, '陆景深', 'protagonist', 'male', 'young', '剑眉星目,薄唇紧抿,高大挺拔,气势凌厉,眼神冰冷如寒潭', '外冷内热,霸道专一,深情而克制', 'handsome chinese man, sharp eyebrows, thin lips, tall and imposing, cold piercing eyes, black suit, CEO style'),
(3, 1, '林诗韵', 'supporting', 'female', 'young', '容貌出众,浓妆艳抹,身姿妖娆', '任性自私,贪慕虚荣', 'beautiful chinese woman, heavy makeup, glamorous figure, designer clothes');
INSERT INTO node_characters (story_id, node_key, character_id, is_speaker, emotion) VALUES
(1, 'start', 1, 0, 'nervous'),
(1, 'start', 2, 0, 'neutral'),
(1, 'choice1_a', 1, 0, 'anxious'),
(1, 'choice1_a', 2, 1, 'cold'),
(1, 'choice1_b', 1, 0, 'scared'),
(1, 'choice1_b', 2, 1, 'amused'),
(1, 'choice2_a', 1, 1, 'honest'),
(1, 'choice2_a', 2, 0, 'interested'),
(1, 'choice2_b', 1, 1, 'nervous'),
(1, 'choice2_b', 2, 0, 'smirking'),
(1, 'ending_good', 1, 0, 'happy'),
(1, 'ending_good', 2, 1, 'loving'),
(1, 'ending_normal', 1, 1, 'calm'),
(1, 'ending_normal', 2, 0, 'sad'),
(1, 'ending_bad', 1, 0, 'heartbroken'),
(1, 'ending_bad', 2, 1, 'cruel');
-- ============================================
-- 故事2: 密室中的第四个人
-- ============================================
INSERT INTO story_characters (id, story_id, name, role_type, gender, age_range, appearance, personality, avatar_prompt) VALUES
(4, 2, '王教授', 'supporting', 'male', 'middle', '戴眼镜的中年男人,头发花白,穿着整洁的西装', '学者气质,表面儒雅,实际隐藏着秘密', 'middle-aged chinese man, glasses, graying hair, neat suit, scholarly appearance'),
(5, 2, '苏小姐', 'supporting', 'female', 'young', '穿着名牌,妆容精致,身上有淡淡香水味', '看似高傲,内心脆弱', 'young elegant chinese woman, designer clothes, delicate makeup, wealthy appearance'),
(6, 2, '李明', 'antagonist', 'male', 'young', '沉默寡言的青年,眼神阴沉,嘴角常带冷笑', '隐忍复仇,城府极深', 'young chinese man, gloomy eyes, cold expression, dark casual clothes');
INSERT INTO node_characters (story_id, node_key, character_id, is_speaker, emotion) VALUES
(2, 'start', 4, 0, 'dead'),
(2, 'start', 5, 0, 'shocked'),
(2, 'start', 6, 0, 'calm'),
(2, 'investigate_room', 4, 0, 'dead'),
(2, 'question_su', 5, 1, 'nervous'),
(2, 'question_li', 6, 1, 'cold'),
(2, 'accuse_su', 5, 1, 'crying'),
(2, 'accuse_li', 6, 1, 'vengeful'),
(2, 'ending_truth', 6, 1, 'resigned'),
(2, 'ending_wrong', 5, 0, 'wronged');
-- ============================================
-- 故事3: 凤临天下
-- ============================================
INSERT INTO story_characters (id, story_id, name, role_type, gender, age_range, appearance, personality, avatar_prompt) VALUES
(7, 3, '林清婉', 'protagonist', 'female', 'young', '眉目如画,肤若凝脂,身姿窈窕,举止端庄', '外柔内刚,隐忍聪慧,心思缜密', 'beautiful ancient chinese woman, delicate features, fair skin, graceful posture, palace costume, elegant hairpin'),
(8, 3, '皇帝', 'protagonist', 'male', 'young', '龙袍加身,眉宇威严,俊朗不凡,气势天成', '深沉多疑,霸道深情', 'handsome ancient chinese emperor, dragon robe, majestic presence, piercing eyes, imperial crown'),
(9, 3, '皇后', 'antagonist', 'female', 'middle', '珠翠环绕,气度雍容,凤冠霞帔,笑容不达眼底', '城府极深,手段狠辣', 'ancient chinese empress, phoenix crown, luxurious robes, dignified bearing, calculating smile');
INSERT INTO node_characters (story_id, node_key, character_id, is_speaker, emotion) VALUES
(3, 'start', 7, 0, 'nervous'),
(3, 'meet_emperor', 7, 1, 'respectful'),
(3, 'meet_emperor', 8, 1, 'curious'),
(3, 'meet_consort', 7, 1, 'cautious'),
(3, 'meet_consort', 9, 1, 'scrutinizing'),
(3, 'choice_emperor', 7, 1, 'humble'),
(3, 'choice_emperor', 8, 1, 'pleased'),
(3, 'choice_queen', 7, 1, 'calculating'),
(3, 'choice_queen', 9, 1, 'satisfied'),
(3, 'ending_empress', 7, 0, 'triumphant'),
(3, 'ending_empress', 8, 1, 'loving'),
(3, 'ending_concubine', 7, 0, 'peaceful'),
(3, 'ending_tragic', 7, 0, 'despairing');
-- ============================================
-- 故事4: 暗恋那件小事
-- ============================================
INSERT INTO story_characters (id, story_id, name, role_type, gender, age_range, appearance, personality, avatar_prompt) VALUES
(10, 4, '', 'protagonist', 'female', 'teen', '扎着马尾的高中女生,青涩可爱,眼神里藏着小秘密', '内向害羞,暗恋成痴,纯真善良', 'teenage chinese girl, ponytail, school uniform, shy expression, cute appearance'),
(11, 4, '沈昼', 'protagonist', 'male', 'teen', '校园男神,阳光帅气,篮球服下身材修长,笑起来眼睛弯弯', '温柔体贴,学霸气质,暖心细腻', 'handsome teenage chinese boy, school uniform, basketball jersey, warm smile, athletic build'),
(12, 4, '同桌', 'supporting', 'female', 'teen', '活泼开朗的女生,表情丰富,是个话痨', '热心肠,爱八卦,仗义', 'cheerful teenage chinese girl, expressive face, school uniform, lively personality');
INSERT INTO node_characters (story_id, node_key, character_id, is_speaker, emotion) VALUES
(4, 'start', 10, 0, 'daydreaming'),
(4, 'start', 11, 0, 'neutral'),
(4, 'start', 12, 1, 'teasing'),
(4, 'library', 10, 1, 'flustered'),
(4, 'library', 11, 1, 'gentle'),
(4, 'basketball', 10, 0, 'excited'),
(4, 'basketball', 11, 1, 'playful'),
(4, 'rooftop', 10, 0, 'nervous'),
(4, 'rooftop', 11, 1, 'serious'),
(4, 'confess_yes', 10, 1, 'brave'),
(4, 'confess_yes', 11, 0, 'happy'),
(4, 'confess_no', 10, 0, 'tearful'),
(4, 'ending_friends', 10, 0, 'regretful');
-- ============================================
-- 故事5: 废柴逆袭录
-- ============================================
INSERT INTO story_characters (id, story_id, name, role_type, gender, age_range, appearance, personality, avatar_prompt) VALUES
(13, 5, '陈风', 'protagonist', 'male', 'young', '相貌普通的少年,眼神坚定,穿着破旧的外门弟子服', '隐忍不屈,心性坚韧,大智若愚', 'young chinese man, ordinary appearance, determined eyes, worn-out cultivation robes, underdog aura'),
(14, 5, '天元大帝', 'supporting', 'male', 'old', '白发苍苍的虚影,仙风道骨,眼中闪烁着智慧的光芒', '睿智从容,亦师亦友', 'ancient chinese immortal, white long hair, ethereal figure, wise eyes, flowing robes, ghostly appearance'),
(15, 5, '赵天龙', 'antagonist', 'male', 'young', '内门弟子,华服锦衣,面带傲色,眼高于顶', '嚣张跋扈,欺软怕硬', 'arrogant young chinese man, luxurious cultivation robes, haughty expression, inner sect disciple');
INSERT INTO node_characters (story_id, node_key, character_id, is_speaker, emotion) VALUES
(5, 'start', 13, 0, 'oppressed'),
(5, 'inheritance', 13, 0, 'shocked'),
(5, 'inheritance', 14, 1, 'wise'),
(5, 'challenge', 13, 0, 'calm'),
(5, 'challenge', 15, 1, 'mocking'),
(5, 'show_power', 13, 1, 'confident'),
(5, 'show_power', 15, 0, 'terrified'),
(5, 'hide_power', 13, 0, 'scheming'),
(5, 'hide_power', 14, 1, 'approving'),
(5, 'ending_immortal', 13, 0, 'transcendent'),
(5, 'ending_mortal', 13, 0, 'peaceful');
-- ============================================
-- 故事6: 回到高考前一天
-- ============================================
INSERT INTO story_characters (id, story_id, name, role_type, gender, age_range, appearance, personality, avatar_prompt) VALUES
(16, 6, '', 'protagonist', 'male', 'teen', '穿着高中校服的少年,眼神带着超越年龄的沧桑', '成熟稳重,心怀遗憾,想要改变', 'teenage chinese boy, school uniform, eyes with wisdom beyond age, determined expression'),
(17, 6, '林小雨', 'supporting', 'female', 'teen', '瘦弱的女孩,眼眶微红,神情木然', '敏感脆弱,承受着巨大压力', 'fragile teenage chinese girl, red-rimmed eyes, blank expression, thin figure, school uniform'),
(18, 6, '爷爷', 'supporting', 'male', 'old', '慈祥的老人,满头银发,笑容温暖', '和蔼可亲,疼爱孙辈', 'kind elderly chinese man, silver hair, warm smile, traditional chinese clothes');
INSERT INTO node_characters (story_id, node_key, character_id, is_speaker, emotion) VALUES
(6, 'start', 16, 0, 'shocked'),
(6, 'choice_study', 16, 0, 'focused'),
(6, 'choice_relax', 16, 0, 'thoughtful'),
(6, 'visit_girl', 16, 1, 'concerned'),
(6, 'visit_girl', 17, 1, 'vulnerable'),
(6, 'ending_perfect', 16, 0, 'fulfilled'),
(6, 'ending_changed', 16, 0, 'content'),
(6, 'ending_changed', 17, 1, 'grateful');
-- ============================================
-- 故事7: 逆风翻盘
-- ============================================
INSERT INTO story_characters (id, story_id, name, role_type, gender, age_range, appearance, personality, avatar_prompt) VALUES
(19, 7, '陈墨', 'protagonist', 'male', 'young', '改头换面后的复仇者,西装革履,眼神锐利如鹰', '隐忍多年,城府极深,复仇心切', 'handsome chinese businessman, sharp suit, eagle-like eyes, confident posture, mysterious aura'),
(20, 7, '周明', 'antagonist', 'male', 'middle', '发福的中年男人,眼神世故贪婪,穿着名牌却掩不住小人嘴脸', '背信弃义,贪婪无耻', 'overweight chinese businessman, greedy eyes, expensive suit, treacherous appearance');
INSERT INTO node_characters (story_id, node_key, character_id, is_speaker, emotion) VALUES
(7, 'start', 19, 0, 'vengeful'),
(7, 'meeting', 19, 1, 'calculating'),
(7, 'meeting', 20, 1, 'obsequious'),
(7, 'expose', 19, 1, 'revealing'),
(7, 'expose', 20, 1, 'terrified'),
(7, 'ending_revenge', 19, 0, 'empty'),
(7, 'ending_forgive', 19, 0, 'liberated');
-- ============================================
-- 故事8: 2099最后一班地铁
-- ============================================
INSERT INTO story_characters (id, story_id, name, role_type, gender, age_range, appearance, personality, avatar_prompt) VALUES
(21, 8, '', 'protagonist', 'male', 'young', '末世的普通人,穿着简朴,眼神迷茫又带着一丝希望', '迷茫困惑,渴望改变', 'young man in futuristic simple clothes, contemplative expression, sci-fi subway setting'),
(22, 8, 'Zero', 'supporting', 'female', 'young', '穿白裙的神秘女孩,眼睛明亮,不属于这个时代', '超然世外,引导者', 'mysterious girl in white dress, bright luminous eyes, ethereal beauty, futuristic subway conductor');
INSERT INTO node_characters (story_id, node_key, character_id, is_speaker, emotion) VALUES
(8, 'start', 21, 0, 'curious'),
(8, 'start', 22, 1, 'welcoming'),
(8, 'talk_girl', 21, 1, 'questioning'),
(8, 'talk_girl', 22, 1, 'mysterious'),
(8, 'choose_past', 21, 1, 'hopeful'),
(8, 'choose_past', 22, 1, 'guiding'),
(8, 'ending_past', 21, 0, 'determined'),
(8, 'ending_past', 22, 1, 'encouraging'),
(8, 'ending_future', 21, 0, 'amazed'),
(8, 'ending_future', 22, 1, 'serene');
-- ============================================
-- 故事9: 第七夜
-- ============================================
INSERT INTO story_characters (id, story_id, name, role_type, gender, age_range, appearance, personality, avatar_prompt) VALUES
(23, 9, '', 'protagonist', 'male', 'young', '被困旅馆的旅客,神情紧张,黑眼圈明显', '胆小谨慎,求生欲强', 'nervous young man, dark circles under eyes, casual travel clothes, fearful expression'),
(24, 9, '老板娘', 'supporting', 'female', 'middle', '面容苍老,眼神奇怪,穿着老旧的旗袍', '神秘莫测,知道真相', 'mysterious middle-aged chinese woman, old-fashioned qipao, strange knowing eyes, creepy inn keeper'),
(25, 9, '白裙女孩', 'antagonist', 'female', 'young', '苍白的脸,穿着白裙,笑容诡异,若隐若现', '怨念深重,寻找陪伴', 'pale ghost girl in white dress, eerie smile, translucent figure, long black hair covering face, horror style');
INSERT INTO node_characters (story_id, node_key, character_id, is_speaker, emotion) VALUES
(9, 'start', 23, 0, 'uneasy'),
(9, 'start', 24, 1, 'cryptic'),
(9, 'night_sound', 23, 0, 'terrified'),
(9, 'night_sound', 25, 1, 'pleading'),
(9, 'open_door', 23, 0, 'horrified'),
(9, 'open_door', 25, 1, 'sinister'),
(9, 'not_open', 23, 0, 'anxious'),
(9, 'ending_death', 23, 0, 'dying'),
(9, 'ending_death', 25, 1, 'satisfied'),
(9, 'ending_escape', 23, 0, 'relieved');
-- ============================================
-- 故事10: 我的室友是只猫
-- ============================================
INSERT INTO story_characters (id, story_id, name, role_type, gender, age_range, appearance, personality, avatar_prompt) VALUES
(26, 10, '', 'protagonist', 'male', 'young', '普通大学生,一脸懵逼,被室友变猫吓到', '善良搞笑,容易慌张', 'confused chinese college student, dorm room setting, panicked expression, casual clothes'),
(27, 10, '室友/橘猫', 'protagonist', 'male', 'young', '胖胖的橘色大猫,会说话,表情丰富,原本是个学霸', '聪明话多,倒霉体质,吃货', 'fat orange tabby cat, expressive face, sitting like human, funny expression, college dorm background');
INSERT INTO node_characters (story_id, node_key, character_id, is_speaker, emotion) VALUES
(10, 'start', 26, 0, 'shocked'),
(10, 'start', 27, 1, 'frustrated'),
(10, 'panic', 26, 1, 'panicking'),
(10, 'panic', 27, 1, 'embarrassed'),
(10, 'exam_plan', 26, 0, 'thinking'),
(10, 'exam_plan', 27, 1, 'excited'),
(10, 'bring_cat', 26, 0, 'nervous'),
(10, 'bring_cat', 27, 1, 'whispering'),
(10, 'ending_funny', 26, 0, 'relieved'),
(10, 'ending_funny', 27, 1, 'smug'),
(10, 'ending_caught', 26, 0, 'doomed'),
(10, 'ending_caught', 27, 1, 'defeated');