UNPKG

yijing-bazi-mcp

Version:

易经八字分析 MCP 服务器 - 提供传统命理分析和易经卦象解读的AI工具

1,066 lines (1,036 loc) 34.2 kB
/** * 知识数据库 * 包含易经和八字的基础知识数据 */ // 六十四卦数据 const hexagramsData = { 1: { name: '乾', chinese: '乾为天', symbol: '☰☰', upper_trigram: '乾', lower_trigram: '乾', element: '金', meaning: '刚健中正', judgment: '元亨利贞', image: '天行健,君子以自强不息', interpretation: { general: '大吉大利,事业亨通,但需要持之以恒', career: '事业发展顺利,适合创业和领导', relationship: '感情稳定,但需要主动', health: '身体健康,精力充沛', wealth: '财运亨通,投资有利' }, lines: [ { position: 1, text: '潜龙勿用', meaning: '时机未到,需要等待' }, { position: 2, text: '见龙在田', meaning: '崭露头角,开始发展' }, { position: 3, text: '君子终日乾乾', meaning: '勤奋努力,谨慎行事' }, { position: 4, text: '或跃在渊', meaning: '面临选择,需要决断' }, { position: 5, text: '飞龙在天', meaning: '事业巅峰,大展宏图' }, { position: 6, text: '亢龙有悔', meaning: '盛极而衰,需要收敛' } ] }, 2: { name: '坤', chinese: '坤为地', symbol: '☷☷', upper_trigram: '坤', lower_trigram: '坤', element: '土', meaning: '柔顺承载', judgment: '元亨,利牝马之贞', image: '地势坤,君子以厚德载物', interpretation: { general: '顺应时势,以柔克刚,厚德载物', career: '适合辅助工作,团队合作', relationship: '温柔体贴,包容理解', health: '注意脾胃,保持平和心态', wealth: '稳健理财,积少成多' }, lines: [ { position: 1, text: '履霜,坚冰至', meaning: '小心谨慎,防微杜渐' }, { position: 2, text: '直方大,不习无不利', meaning: '正直宽容,自然有利' }, { position: 3, text: '含章可贞', meaning: '内含美德,坚持正道' }, { position: 4, text: '括囊,无咎无誉', meaning: '谨言慎行,避免是非' }, { position: 5, text: '黄裳,元吉', meaning: '德行高尚,大吉大利' }, { position: 6, text: '龙战于野', meaning: '阴阳相争,需要调和' } ] }, // 可以继续添加其他卦象... }; // 八卦基础数据 const trigramsData = { '乾': { symbol: '☰', element: '金', direction: '西北', season: '秋冬之交', family: '父', body: '头', animal: '马', color: '白', number: 1, meaning: '天、刚健、创造', characteristics: ['刚强', '主动', '创造', '领导'] }, '坤': { symbol: '☷', element: '土', direction: '西南', season: '夏秋之交', family: '母', body: '腹', animal: '牛', color: '黄', number: 8, meaning: '地、柔顺、承载', characteristics: ['柔顺', '包容', '承载', '滋养'] }, '震': { symbol: '☳', element: '木', direction: '东', season: '春', family: '长男', body: '足', animal: '龙', color: '青', number: 4, meaning: '雷、动、奋起', characteristics: ['震动', '奋发', '主动', '决断'] }, '巽': { symbol: '☴', element: '木', direction: '东南', season: '春夏之交', family: '长女', body: '股', animal: '鸡', color: '绿', number: 5, meaning: '风、入、顺从', characteristics: ['柔和', '渗透', '顺从', '灵活'] }, '坎': { symbol: '☵', element: '水', direction: '北', season: '冬', family: '中男', body: '耳', animal: '豕', color: '黑', number: 6, meaning: '水、险、智慧', characteristics: ['流动', '智慧', '险阻', '包容'] }, '离': { symbol: '☲', element: '火', direction: '南', season: '夏', family: '中女', body: '目', animal: '雉', color: '红', number: 3, meaning: '火、明、美丽', characteristics: ['光明', '美丽', '文明', '热情'] }, '艮': { symbol: '☶', element: '土', direction: '东北', season: '冬春之交', family: '少男', body: '手', animal: '狗', color: '黄', number: 7, meaning: '山、止、稳定', characteristics: ['稳定', '停止', '专注', '坚实'] }, '兑': { symbol: '☱', element: '金', direction: '西', season: '秋', family: '少女', body: '口', animal: '羊', color: '白', number: 2, meaning: '泽、悦、交流', characteristics: ['喜悦', '交流', '收获', '满足'] } }; // 天干数据 const heavenlyStemsData = { '甲': { element: '木', polarity: '阳', direction: '东', season: '春', color: '青', meaning: '生发、创始', characteristics: ['主动', '创新', '领导', '开拓'], personality: '积极进取,具有领导才能,喜欢开创新事业' }, '乙': { element: '木', polarity: '阴', direction: '东', season: '春', color: '绿', meaning: '柔和、成长', characteristics: ['柔和', '适应', '成长', '美丽'], personality: '温和善良,适应性强,具有艺术天赋' }, '丙': { element: '火', polarity: '阳', direction: '南', season: '夏', color: '红', meaning: '光明、热情', characteristics: ['热情', '光明', '积极', '外向'], personality: '热情开朗,积极向上,具有感染力' }, '丁': { element: '火', polarity: '阴', direction: '南', season: '夏', color: '紫', meaning: '文明、精神', characteristics: ['文雅', '精神', '细腻', '智慧'], personality: '文雅细腻,思维敏捷,具有艺术气质' }, '戊': { element: '土', polarity: '阳', direction: '中', season: '长夏', color: '黄', meaning: '厚重、包容', characteristics: ['稳重', '包容', '实际', '可靠'], personality: '稳重可靠,包容性强,具有实干精神' }, '己': { element: '土', polarity: '阴', direction: '中', season: '长夏', color: '黄', meaning: '柔和、滋养', characteristics: ['温和', '滋养', '细心', '体贴'], personality: '温和体贴,善于照顾他人,具有母性光辉' }, '庚': { element: '金', polarity: '阳', direction: '西', season: '秋', color: '白', meaning: '刚强、果断', characteristics: ['刚强', '果断', '正义', '坚持'], personality: '刚强果断,正义感强,具有执行力' }, '辛': { element: '金', polarity: '阴', direction: '西', season: '秋', color: '白', meaning: '精细、美丽', characteristics: ['精细', '美丽', '敏感', '完美'], personality: '精细敏感,追求完美,具有审美能力' }, '壬': { element: '水', polarity: '阳', direction: '北', season: '冬', color: '黑', meaning: '流动、智慧', characteristics: ['智慧', '流动', '变化', '包容'], personality: '智慧灵活,适应性强,具有包容心' }, '癸': { element: '水', polarity: '阴', direction: '北', season: '冬', color: '黑', meaning: '滋润、内敛', characteristics: ['内敛', '滋润', '深沉', '智慧'], personality: '内敛深沉,思考深入,具有洞察力' } }; // 地支数据 const earthlyBranchesData = { '子': { element: '水', polarity: '阳', time: '23:00-01:00', month: '十一月', season: '冬', direction: '北', animal: '鼠', meaning: '开始、萌芽', characteristics: ['机智', '灵活', '适应', '开始'], hidden_stems: [{ stem: '癸', strength: 1.0 }] }, '丑': { element: '土', polarity: '阴', time: '01:00-03:00', month: '十二月', season: '冬', direction: '东北', animal: '牛', meaning: '积累、稳定', characteristics: ['稳重', '勤劳', '积累', '坚持'], hidden_stems: [ { stem: '己', strength: 0.6 }, { stem: '癸', strength: 0.3 }, { stem: '辛', strength: 0.1 } ] }, '寅': { element: '木', polarity: '阳', time: '03:00-05:00', month: '正月', season: '春', direction: '东北', animal: '虎', meaning: '生发、勇猛', characteristics: ['勇猛', '生发', '主动', '领导'], hidden_stems: [ { stem: '甲', strength: 0.6 }, { stem: '丙', strength: 0.3 }, { stem: '戊', strength: 0.1 } ] }, '卯': { element: '木', polarity: '阴', time: '05:00-07:00', month: '二月', season: '春', direction: '东', animal: '兔', meaning: '温和、成长', characteristics: ['温和', '成长', '美丽', '和谐'], hidden_stems: [{ stem: '乙', strength: 1.0 }] }, '辰': { element: '土', polarity: '阳', time: '07:00-09:00', month: '三月', season: '春', direction: '东南', animal: '龙', meaning: '变化、活跃', characteristics: ['变化', '活跃', '智慧', '神秘'], hidden_stems: [ { stem: '戊', strength: 0.6 }, { stem: '乙', strength: 0.3 }, { stem: '癸', strength: 0.1 } ] }, '巳': { element: '火', polarity: '阴', time: '09:00-11:00', month: '四月', season: '夏', direction: '东南', animal: '蛇', meaning: '智慧、神秘', characteristics: ['智慧', '神秘', '深沉', '洞察'], hidden_stems: [ { stem: '丙', strength: 0.6 }, { stem: '戊', strength: 0.3 }, { stem: '庚', strength: 0.1 } ] }, '午': { element: '火', polarity: '阳', time: '11:00-13:00', month: '五月', season: '夏', direction: '南', animal: '马', meaning: '热情、奔放', characteristics: ['热情', '奔放', '积极', '光明'], hidden_stems: [ { stem: '丁', strength: 0.7 }, { stem: '己', strength: 0.3 } ] }, '未': { element: '土', polarity: '阴', time: '13:00-15:00', month: '六月', season: '夏', direction: '西南', animal: '羊', meaning: '温和、包容', characteristics: ['温和', '包容', '艺术', '美丽'], hidden_stems: [ { stem: '己', strength: 0.6 }, { stem: '丁', strength: 0.3 }, { stem: '乙', strength: 0.1 } ] }, '申': { element: '金', polarity: '阳', time: '15:00-17:00', month: '七月', season: '秋', direction: '西南', animal: '猴', meaning: '机智、变化', characteristics: ['机智', '变化', '灵活', '创新'], hidden_stems: [ { stem: '庚', strength: 0.6 }, { stem: '壬', strength: 0.3 }, { stem: '戊', strength: 0.1 } ] }, '酉': { element: '金', polarity: '阴', time: '17:00-19:00', month: '八月', season: '秋', direction: '西', animal: '鸡', meaning: '收获、完美', characteristics: ['完美', '收获', '精细', '美丽'], hidden_stems: [{ stem: '辛', strength: 1.0 }] }, '戌': { element: '土', polarity: '阳', time: '19:00-21:00', month: '九月', season: '秋', direction: '西北', animal: '狗', meaning: '忠诚、守护', characteristics: ['忠诚', '守护', '责任', '坚持'], hidden_stems: [ { stem: '戊', strength: 0.6 }, { stem: '辛', strength: 0.3 }, { stem: '丁', strength: 0.1 } ] }, '亥': { element: '水', polarity: '阴', time: '21:00-23:00', month: '十月', season: '冬', direction: '西北', animal: '猪', meaning: '包容、结束', characteristics: ['包容', '结束', '智慧', '深沉'], hidden_stems: [ { stem: '壬', strength: 0.7 }, { stem: '甲', strength: 0.3 } ] } }; // 五行相生相克关系 const elementRelations = { generating: { '木': '火', '火': '土', '土': '金', '金': '水', '水': '木' }, destructive: { '木': '土', '火': '金', '土': '水', '金': '木', '水': '火' }, characteristics: { '木': { nature: '生发、成长', season: '春', direction: '东', color: '青绿', emotion: '怒', organ: '肝胆', taste: '酸', personality: ['仁慈', '正直', '进取', '创新'] }, '火': { nature: '炎热、光明', season: '夏', direction: '南', color: '红', emotion: '喜', organ: '心小肠', taste: '苦', personality: ['热情', '积极', '礼貌', '文明'] }, '土': { nature: '承载、包容', season: '长夏', direction: '中', color: '黄', emotion: '思', organ: '脾胃', taste: '甘', personality: ['诚信', '稳重', '包容', '实际'] }, '金': { nature: '收敛、坚硬', season: '秋', direction: '西', color: '白', emotion: '悲', organ: '肺大肠', taste: '辛', personality: ['正义', '果断', '坚持', '完美'] }, '水': { nature: '流动、智慧', season: '冬', direction: '北', color: '黑', emotion: '恐', organ: '肾膀胱', taste: '咸', personality: ['智慧', '灵活', '包容', '深沉'] } } }; // 十神关系数据 const tenGodsData = { '比肩': { relationship: '同我', meaning: '平等、竞争、合作', characteristics: ['自立', '竞争', '合作', '平等'], positive: ['独立自主', '有主见', '善于合作'], negative: ['固执己见', '竞争激烈', '不易妥协'], career: '适合合伙经营、团队工作', personality: '性格坚强,有主见,善于与同辈合作' }, '劫财': { relationship: '同我', meaning: '争夺、冲突、变化', characteristics: ['争夺', '冲突', '变化', '冒险'], positive: ['敢于冒险', '适应变化', '行动力强'], negative: ['容易冲突', '财运不稳', '关系复杂'], career: '适合变化性工作、投机行业', personality: '性格冲动,喜欢变化,容易与人发生冲突' }, '食神': { relationship: '我生', meaning: '才华、表达、享受', characteristics: ['才华', '表达', '享受', '创造'], positive: ['才华横溢', '表达能力强', '生活享受'], negative: ['过于享乐', '缺乏进取', '挥霍无度'], career: '适合艺术、娱乐、餐饮行业', personality: '性格开朗,有才华,喜欢享受生活' }, '伤官': { relationship: '我生', meaning: '叛逆、创新、表现', characteristics: ['叛逆', '创新', '表现', '批判'], positive: ['创新能力强', '表现欲强', '思维敏捷'], negative: ['叛逆心重', '容易得罪人', '不服管束'], career: '适合创新、艺术、技术行业', personality: '性格叛逆,有创新精神,不喜欢受约束' }, '偏财': { relationship: '我克', meaning: '机遇、投机、外财', characteristics: ['机遇', '投机', '外财', '灵活'], positive: ['善于抓住机遇', '财运较好', '交际能力强'], negative: ['投机心重', '财来财去', '感情复杂'], career: '适合商业、投资、销售行业', personality: '性格灵活,善于交际,有商业头脑' }, '正财': { relationship: '我克', meaning: '稳定、勤劳、正当', characteristics: ['稳定', '勤劳', '正当', '节俭'], positive: ['财运稳定', '勤劳节俭', '责任心强'], negative: ['过于保守', '缺乏冒险', '计较得失'], career: '适合稳定工作、理财、会计', personality: '性格稳重,勤劳节俭,有责任心' }, '七杀': { relationship: '克我', meaning: '压力、挑战、权威', characteristics: ['压力', '挑战', '权威', '竞争'], positive: ['有魄力', '能承受压力', '具有权威'], negative: ['压力过大', '容易冲动', '关系紧张'], career: '适合管理、军警、竞争性行业', personality: '性格刚强,有魄力,能承受压力' }, '正官': { relationship: '克我', meaning: '责任、约束、地位', characteristics: ['责任', '约束', '地位', '规范'], positive: ['有责任心', '遵守规则', '有地位'], negative: ['过于保守', '缺乏创新', '压力较大'], career: '适合公务员、管理、教育行业', personality: '性格正直,有责任心,遵守规则' }, '偏印': { relationship: '生我', meaning: '偏门、技艺、孤独', characteristics: ['偏门', '技艺', '孤独', '神秘'], positive: ['有特殊技能', '思维独特', '学习能力强'], negative: ['性格孤僻', '思维偏激', '不易相处'], career: '适合技术、研究、偏门行业', personality: '性格内向,有特殊才能,思维独特' }, '正印': { relationship: '生我', meaning: '学习、保护、慈爱', characteristics: ['学习', '保护', '慈爱', '智慧'], positive: ['学习能力强', '有贵人相助', '慈爱仁厚'], negative: ['依赖性强', '缺乏主见', '过于保守'], career: '适合教育、文化、慈善行业', personality: '性格温和,有学习能力,容易得到帮助' } }; // 八字格局数据 const eightCharacterPatternsData = { '正官格': { description: '正官透干有力,为人正直', characteristics: ['正直', '有责任心', '遵纪守法', '有地位'], suitable_career: ['公务员', '管理', '教育', '法律'], life_advice: '适合从事管理工作,发挥领导才能', famous_examples: ['政治家', '企业家', '教育家', '法官'] }, '七杀格': { description: '七杀透干有力,性格刚强', characteristics: ['刚强', '有魄力', '敢于挑战', '竞争力强'], suitable_career: ['军警', '竞技', '销售', '创业'], life_advice: '适合从事竞争性工作,发挥拼搏精神', famous_examples: ['军人', '运动员', '销售精英', '创业者'] }, '正财格': { description: '正财透干有力,善于理财', characteristics: ['勤劳', '节俭', '善理财', '责任心强'], suitable_career: ['财务', '银行', '会计', '实业'], life_advice: '适合从事财务工作,稳健发展', famous_examples: ['会计师', '银行家', '实业家', '理财师'] }, '偏财格': { description: '偏财透干有力,善于投机', characteristics: ['灵活', '善交际', '投机性强', '财运好'], suitable_career: ['商业', '投资', '销售', '娱乐'], life_advice: '适合从事商业投资,把握机遇', famous_examples: ['商人', '投资家', '经纪人', '娱乐业者'] }, '食神格': { description: '食神透干有力,才华横溢', characteristics: ['有才华', '表达力强', '享受生活', '创造力强'], suitable_career: ['艺术', '娱乐', '餐饮', '文化'], life_advice: '适合从事艺术创作,发挥才华', famous_examples: ['艺术家', '作家', '厨师', '娱乐明星'] }, '伤官格': { description: '伤官透干有力,聪明叛逆', characteristics: ['聪明', '叛逆', '创新', '表现欲强'], suitable_career: ['技术', '艺术', '媒体', '创新'], life_advice: '适合从事创新工作,发挥聪明才智', famous_examples: ['科学家', '发明家', '艺术家', '媒体人'] }, '正印格': { description: '正印透干有力,学识渊博', characteristics: ['学识渊博', '有智慧', '慈祥', '保守'], suitable_career: ['教育', '文化', '宗教', '慈善'], life_advice: '适合从事教育文化,传播知识', famous_examples: ['教师', '学者', '宗教人士', '慈善家'] }, '偏印格': { description: '偏印透干有力,技艺精湛', characteristics: ['技艺精湛', '思维独特', '孤僻', '神秘'], suitable_career: ['技术', '艺术', '医学', '神秘学'], life_advice: '适合从事专业技术,发挥特长', famous_examples: ['技术专家', '医生', '艺术家', '研究员'] }, '比肩格': { description: '比肩透干有力,自立自强', characteristics: ['自立', '坚强', '有主见', '合作性强'], suitable_career: ['合伙', '团队', '自由职业', '服务'], life_advice: '适合合伙经营,发挥团队精神', famous_examples: ['合伙人', '团队领导', '自由职业者', '服务业者'] }, '劫财格': { description: '劫财透干有力,冒险进取', characteristics: ['冒险', '进取', '变化', '竞争'], suitable_career: ['投机', '变化性', '竞争性', '冒险性'], life_advice: '适合从事变化性工作,把握机遇', famous_examples: ['投机商', '冒险家', '变革者', '竞争者'] } }; // 格局数据 const patternsData = { '建禄格': { description: '日主与月支同气,身强有力', characteristics: ['身强', '自立', '创业', '领导'], suitable_career: ['创业', '管理', '领导', '自由职业'], life_advice: '适合自主创业,发挥领导才能', famous_examples: ['企业家', '政治家', '军事家'] }, '印绶格': { description: '月支生助日主,聪明好学', characteristics: ['聪明', '好学', '文雅', '贵人'], suitable_career: ['教育', '文化', '学术', '公务员'], life_advice: '适合从事文化教育工作,发挥智慧才能', famous_examples: ['学者', '教师', '文人', '公务员'] }, '食伤格': { description: '日主生月支,才华横溢', characteristics: ['才华', '创意', '表达', '艺术'], suitable_career: ['艺术', '创意', '娱乐', '技术'], life_advice: '适合发挥创意才能,从事艺术或技术工作', famous_examples: ['艺术家', '作家', '设计师', '技术专家'] }, '财格': { description: '日主克月支,善于理财', characteristics: ['理财', '商业', '实际', '务实'], suitable_career: ['商业', '金融', '投资', '销售'], life_advice: '适合从事商业活动,发挥理财能力', famous_examples: ['商人', '银行家', '投资家', '销售专家'] }, '官杀格': { description: '月支克日主,有责任心', characteristics: ['责任', '管理', '权威', '约束'], suitable_career: ['管理', '公务', '法律', '军警'], life_advice: '适合从事管理工作,承担社会责任', famous_examples: ['官员', '法官', '警察', '管理者'] }, '从革格': { description: '金气极旺,性格刚强', characteristics: ['刚强', '果断', '技术', '精密'], suitable_career: ['技术', '工程', '制造', '金融'], life_advice: '适合从事技术工作,发挥专业技能', famous_examples: ['工程师', '技术专家', '制造业者'] }, '炎上格': { description: '火气极旺,热情积极', characteristics: ['热情', '积极', '表演', '光明'], suitable_career: ['表演', '艺术', '娱乐', '宣传'], life_advice: '适合从事表演艺术,发挥表现才能', famous_examples: ['演员', '艺术家', '主持人', '宣传员'] }, '润下格': { description: '水气极旺,智慧灵活', characteristics: ['智慧', '灵活', '流动', '变化'], suitable_career: ['流通', '运输', '信息', '服务'], life_advice: '适合从事流动性工作,发挥灵活性', famous_examples: ['商人', '外交官', '记者', '服务业者'] }, '曲直格': { description: '木气极旺,仁慈正直', characteristics: ['仁慈', '正直', '成长', '教育'], suitable_career: ['教育', '慈善', '医疗', '农业'], life_advice: '适合从事教育或慈善工作,发挥仁爱精神', famous_examples: ['教师', '医生', '慈善家', '农业专家'] }, '稼穑格': { description: '土气极旺,诚实稳重', characteristics: ['诚实', '稳重', '实际', '承载'], suitable_career: ['农业', '地产', '建筑', '物流'], life_advice: '适合从事实业工作,发挥稳重品格', famous_examples: ['农业专家', '建筑师', '地产商', '物流专家'] } }; // 流年大运影响数据 const luckInfluenceData = { favorable: { '木': { description: '木运当头,生机勃勃', effects: ['事业发展', '创新机会', '人际和谐', '健康向上'], advice: '把握机会,积极进取,注重人际关系' }, '火': { description: '火运炽盛,光明热烈', effects: ['名声提升', '表现机会', '感情顺利', '精神振奋'], advice: '展现才华,积极表现,注意情绪管理' }, '土': { description: '土运稳固,厚德载物', effects: ['基础稳固', '财运稳定', '家庭和睦', '身体健康'], advice: '稳扎稳打,积累实力,注重家庭和健康' }, '金': { description: '金运收获,果实累累', effects: ['收获成果', '财运亨通', '地位提升', '决断有力'], advice: '收获成果,理性决策,注意人际关系' }, '水': { description: '水运流通,智慧如泉', effects: ['智慧增长', '学习机会', '变化适应', '财源广进'], advice: '学习充电,适应变化,发挥智慧才能' } }, unfavorable: { '木': { description: '木运受克,成长受阻', effects: ['发展受阻', '人际紧张', '健康问题', '情绪波动'], advice: '保持耐心,调整策略,注意健康和情绪' }, '火': { description: '火运受制,光芒暗淡', effects: ['名声受损', '表现不佳', '感情波折', '精神压抑'], advice: '低调行事,修养内功,等待时机' }, '土': { description: '土运动荡,根基不稳', effects: ['基础动摇', '财运不稳', '家庭不和', '健康问题'], advice: '稳定为主,避免冒险,注重基础建设' }, '金': { description: '金运受损,锋芒受挫', effects: ['决策失误', '财运受损', '地位下降', '人际冲突'], advice: '谨慎决策,避免冲突,修复人际关系' }, '水': { description: '水运枯竭,智慧受阻', effects: ['思维混乱', '学习困难', '变化不利', '财源断绝'], advice: '静心思考,充实自己,等待转机' } } }; // 健康养生数据 const healthData = { constitution_types: { '木型': { characteristics: ['身材修长', '面色青白', '性格急躁', '肝胆功能'], health_tendencies: ['肝胆疾病', '眼部问题', '筋骨疾病', '情绪波动'], wellness_advice: [ '保持心情舒畅,避免愤怒', '适当运动,舒展筋骨', '饮食清淡,少食酸辣', '规律作息,充足睡眠' ], suitable_exercise: ['太极拳', '瑜伽', '散步', '游泳'], dietary_advice: ['多食绿色蔬菜', '少食油腻', '适量酸味', '忌辛辣'] }, '火型': { characteristics: ['面色红润', '体型中等', '性格热情', '心脏功能'], health_tendencies: ['心血管疾病', '失眠多梦', '口舌生疮', '血压问题'], wellness_advice: [ '保持心境平和,避免过度兴奋', '适度运动,避免剧烈', '饮食清淡,少食辛辣', '注意休息,避免熬夜' ], suitable_exercise: ['慢跑', '游泳', '太极', '瑜伽'], dietary_advice: ['多食红色食物', '清热降火', '适量苦味', '忌燥热'] }, '土型': { characteristics: ['体型丰满', '面色黄润', '性格稳重', '脾胃功能'], health_tendencies: ['消化系统疾病', '肥胖问题', '湿气重', '代谢缓慢'], wellness_advice: [ '保持心情愉快,避免思虑过度', '适量运动,促进代谢', '饮食规律,少食甜腻', '注意除湿,保持干燥' ], suitable_exercise: ['快走', '爬山', '健身操', '球类运动'], dietary_advice: ['多食黄色食物', '健脾除湿', '适量甘味', '忌生冷'] }, '金型': { characteristics: ['体型方正', '面色白皙', '性格坚毅', '肺部功能'], health_tendencies: ['呼吸系统疾病', '皮肤问题', '大肠疾病', '免疫力低'], wellness_advice: [ '保持心情开朗,避免悲伤', '适当运动,增强体质', '饮食营养,增强免疫', '注意保暖,预防感冒' ], suitable_exercise: ['深呼吸', '慢跑', '登山', '武术'], dietary_advice: ['多食白色食物', '润肺养阴', '适量辛味', '忌寒凉'] }, '水型': { characteristics: ['体型偏胖', '面色黑润', '性格沉静', '肾脏功能'], health_tendencies: ['泌尿系统疾病', '骨骼问题', '生殖系统', '内分泌失调'], wellness_advice: [ '保持心情平静,避免恐惧', '适度运动,强健筋骨', '饮食温补,滋养肾气', '注意保暖,避免寒湿' ], suitable_exercise: ['游泳', '太极', '八段锦', '瑜伽'], dietary_advice: ['多食黑色食物', '温补肾阳', '适量咸味', '忌寒湿'] } }, seasonal_wellness: { '春': { focus: '养肝护肝,疏肝理气', advice: ['早睡早起', '心情舒畅', '适量运动', '饮食清淡'], foods: ['绿色蔬菜', '春笋', '韭菜', '枸杞'], avoid: ['过度劳累', '情绪激动', '油腻食物', '熬夜'] }, '夏': { focus: '养心安神,清热降火', advice: ['午休小憩', '心境平和', '避免暴晒', '多饮水'], foods: ['苦瓜', '莲子', '绿豆', '西瓜'], avoid: ['过度兴奋', '剧烈运动', '辛辣食物', '贪凉'] }, '秋': { focus: '养肺润燥,收敛精神', advice: ['早睡早起', '情绪稳定', '适度运动', '滋阴润燥'], foods: ['梨', '百合', '银耳', '蜂蜜'], avoid: ['悲伤过度', '剧烈运动', '辛辣燥热', '熬夜'] }, '冬': { focus: '养肾藏精,温补阳气', advice: ['早睡晚起', '心境平和', '适度运动', '温补饮食'], foods: ['黑豆', '核桃', '羊肉', '桂圆'], avoid: ['过度疲劳', '房事过度', '生冷食物', '出汗过多'] } } }; // 导出所有数据 const knowledgeDatabase = { hexagrams: hexagramsData, trigrams: trigramsData, heavenly_stems: heavenlyStemsData, earthly_branches: earthlyBranchesData, element_relations: elementRelations, ten_gods: tenGodsData, patterns: eightCharacterPatternsData, luck_influence: luckInfluenceData, health: healthData }; // 导出KnowledgeDatabase类 class KnowledgeDatabase { constructor() { this.data = knowledgeDatabase; } // 获取所有数据 getAllData() { return this.data; } // 获取卦象数据 getHexagrams() { return this.data.hexagrams; } // 获取八卦数据 getTrigrams() { return this.data.trigrams; } // 获取天干数据 getHeavenlyStems() { return this.data.heavenly_stems; } // 获取地支数据 getEarthlyBranches() { return this.data.earthly_branches; } // 获取五行关系 getElementRelations() { return this.data.element_relations; } // 获取十神数据 getTenGods() { return this.data.ten_gods; } // 获取格局数据 getPatterns() { return this.data.patterns; } // 获取运势影响数据 getLuckInfluence() { return this.data.luck_influence; } // 获取健康数据 getHealthData() { return this.data.health; } // 搜索功能 search(query, category = null) { const results = []; const searchText = query.toLowerCase(); // 搜索卦象 if (!category || category === 'hexagrams') { Object.entries(this.data.hexagrams).forEach(([key, hexagram]) => { if (hexagram.name.includes(searchText) || hexagram.chinese.includes(searchText) || hexagram.meaning.includes(searchText)) { results.push({ type: 'hexagram', id: key, data: hexagram }); } }); } // 搜索八卦 if (!category || category === 'trigrams') { Object.entries(this.data.trigrams).forEach(([key, trigram]) => { if (key.includes(searchText) || trigram.meaning.includes(searchText)) { results.push({ type: 'trigram', id: key, data: trigram }); } }); } // 搜索天干地支 if (!category || category === 'stems_branches') { Object.entries(this.data.heavenly_stems).forEach(([key, stem]) => { if (key.includes(searchText) || stem.meaning.includes(searchText)) { results.push({ type: 'heavenly_stem', id: key, data: stem }); } }); Object.entries(this.data.earthly_branches).forEach(([key, branch]) => { if (key.includes(searchText) || branch.meaning.includes(searchText) || branch.animal.includes(searchText)) { results.push({ type: 'earthly_branch', id: key, data: branch }); } }); } return results; } } module.exports = { hexagramsData, trigramsData, heavenlyStemsData, earthlyBranchesData, elementRelations, tenGodsData, eightCharacterPatternsData, luckInfluenceData, healthData, knowledgeDatabase, KnowledgeDatabase }; module.exports.default = knowledgeDatabase;