Files
jiaowu-test/apply_resume_updates.py
KQL 1b964b3886 chore: 更新数据文件和组件优化
主要更新内容:
- 优化UI组件(视频播放器、HR访问模态框、岗位信息展示等)
- 更新数据文件(简历、岗位、项目案例等)
- 添加新的图片资源(面试状态图标等)
- 新增AgentPage等页面组件
- 清理旧的备份文件,提升代码库整洁度
- 优化岗位等级和面试状态的数据结构

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 15:55:25 +08:00

72 lines
2.9 KiB
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import re
# 读取数据
with open('resume_updates.json', 'r', encoding='utf-8') as f:
updates = json.load(f)
# 读取当前的resumeInterviewMock.js文件
with open('src/mocks/resumeInterviewMock.js', 'r', encoding='utf-8') as f:
content = f.read()
# 定义需要更新的岗位和其所属行业
position_mapping = {
'露营地运营专员': '露营地运营', # 需要创建新行业
'文创产品设计师': '文旅产品设计',
'文创产品策划师': '文旅产品设计',
'文创产品设计师助理': '文旅产品设计',
'品牌策划运营专员': '品牌运营',
'品牌公关': '品牌运营',
'品牌推广专员': '品牌运营',
'ip运营': '品牌运营',
'ip运营总监助理': '品牌运营',
'品牌公关管培生': '品牌运营'
}
# 生成更新代码
for update in updates:
position = update['position']
student_info = update['studentInfo']
# 清理数据中的额外空格和错误文本
if student_info['project_experience']['project_name']:
student_info['project_experience']['project_name'] = student_info['project_experience']['project_name'].strip()
if student_info['project_experience']['position']:
student_info['project_experience']['position'] = student_info['project_experience']['position'].strip()
if student_info['project_experience']['time_period']:
student_info['project_experience']['time_period'] = student_info['project_experience']['time_period'].strip()
if student_info['project_experience']['company']:
student_info['project_experience']['company'] = student_info['project_experience']['company'].strip()
# 清理core_skills中的错误文本
cleaned_core_skills = []
for skill in student_info['core_skills']:
# 移除开头的"chubu "等错误文本
skill = re.sub(r'^chubu\s+', '', skill)
skill = skill.strip()
if skill:
cleaned_core_skills.append(skill)
student_info['core_skills'] = cleaned_core_skills
# 清理compound_skills
cleaned_compound_skills = []
for skill in student_info['compound_skills']:
skill = skill.strip()
if skill:
cleaned_compound_skills.append(skill)
student_info['compound_skills'] = cleaned_compound_skills
print(f"\n处理岗位: {position}")
print(f" - 项目名称: {student_info['project_experience']['project_name']}")
print(f" - 核心技能数: {len(student_info['core_skills'])}")
print(f" - 复合技能数: {len(student_info['compound_skills'])}")
print(f" - 个人总结长度: {len(student_info['personal_summary'])}")
# 保存清理后的数据
with open('resume_updates_cleaned.json', 'w', encoding='utf-8') as f:
json.dump(updates, f, ensure_ascii=False, indent=2)
print("\n数据清理完成,保存到 resume_updates_cleaned.json")