feat: 添加AI课程集成和修复初始化错误
- 将终生学习系统课添加到公共课直播间 - 修复allCalendarEvents初始化顺序问题 - 更正AI课程导师为李奇 - 添加AI课程与日历页面同步功能
This commit is contained in:
54
scripts/update_resume_data.py
Normal file
54
scripts/update_resume_data.py
Normal file
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import json
|
||||
import re
|
||||
|
||||
# 读取个人简历内容.json
|
||||
with open('/Users/apple/Documents/cursor/教务系统/frontend/网页未导入数据/个人简历内容.json', 'r', encoding='utf-8') as f:
|
||||
resume_data = json.load(f)
|
||||
|
||||
# 创建岗位名称到简历内容的映射
|
||||
position_map = {}
|
||||
for item in resume_data:
|
||||
if '❌岗位名称查询' in item and '简历内容' in item:
|
||||
position_name = item['❌岗位名称查询']
|
||||
resume_content = item['简历内容']
|
||||
|
||||
# 解析简历内容,提取项目经历、专业技能和个人总结
|
||||
project_match = re.search(r'# 一、项目经历(.*?)# 二、', resume_content, re.DOTALL)
|
||||
skills_match = re.search(r'# 二、专业技能(.*?)# 三、', resume_content, re.DOTALL)
|
||||
summary_match = re.search(r'# 三、个人[总结评价](.*?)$', resume_content, re.DOTALL)
|
||||
|
||||
project_experience = project_match.group(1).strip() if project_match else ""
|
||||
skills = skills_match.group(1).strip() if skills_match else ""
|
||||
summary = summary_match.group(1).strip() if summary_match else ""
|
||||
|
||||
position_map[position_name] = {
|
||||
'projectExperience': project_experience,
|
||||
'skills': skills,
|
||||
'personalSummary': summary
|
||||
}
|
||||
|
||||
# 输出JavaScript格式的更新代码
|
||||
print("// 岗位简历数据更新映射")
|
||||
print("const resumeDataMap = {")
|
||||
for position_name, content in position_map.items():
|
||||
print(f" '{position_name}': {{")
|
||||
print(f" projectExperience: `{content['projectExperience']}`,")
|
||||
print(f" skills: `{content['skills']}`,")
|
||||
print(f" personalSummary: `{content['personalSummary']}`")
|
||||
print(" },")
|
||||
print("};")
|
||||
print()
|
||||
print("// 更新函数")
|
||||
print("function updateResumeData(positions) {")
|
||||
print(" positions.forEach(position => {")
|
||||
print(" const resumeData = resumeDataMap[position.jobTitle];")
|
||||
print(" if (resumeData) {")
|
||||
print(" position.resumeContent.projectExperience = resumeData.projectExperience;")
|
||||
print(" position.resumeContent.skills = resumeData.skills;")
|
||||
print(" position.resumeContent.personalSummary = resumeData.personalSummary;")
|
||||
print(" }")
|
||||
print(" });")
|
||||
print("}")
|
||||
Reference in New Issue
Block a user