Files
ALL-teach_sys/frontend_大健康/update_modified_resumes_final.py
KQL cd2e307402 初始化12个产业教务系统项目
主要内容:
- 包含12个产业的完整教务系统前端代码
- 智能启动脚本 (start-industry.sh)
- 可视化产业导航页面 (index.html)
- 项目文档 (README.md)

优化内容:
- 删除所有node_modules和.yoyo文件夹,从7.5GB减少到2.7GB
- 添加.gitignore文件避免上传不必要的文件
- 自动依赖管理和智能启动系统

产业列表:
1. 文旅产业 (5150)
2. 智能制造 (5151)
3. 智能开发 (5152)
4. 财经商贸 (5153)
5. 视觉设计 (5154)
6. 交通物流 (5155)
7. 大健康 (5156)
8. 土木水利 (5157)
9. 食品产业 (5158)
10. 化工产业 (5159)
11. 能源产业 (5160)
12. 环保产业 (5161)

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 14:14:14 +08:00

106 lines
3.7 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import json
# 修改版简历文件夹路径
modified_resume_dir = "/Users/apple/Documents/cursor/教务系统/frontend_大健康/网页未导入数据/大健康产业/大健康修改版简历"
# 需要处理的10个岗位
positions_to_update = [
"健康顾问",
"心理咨询师",
"运动康复师",
"体检医生",
"微整形医生",
"皮肤美容医生",
"康复治疗师",
"营养师助理",
"健康管理师助理",
"老年健康照护师"
]
# 读取修改版简历内容
modified_resumes = {}
for position in positions_to_update:
file_path = os.path.join(modified_resume_dir, f"{position}.md")
if os.path.exists(file_path):
with open(file_path, 'r', encoding='utf-8') as f:
# 读取内容并跳过第一行(标题)
lines = f.readlines()
# 从第3行开始跳过标题和空行
content = ''.join(lines[2:]) # 跳过标题行和空行
modified_resumes[position] = content.strip()
print(f"✓ 读取修改版简历:{position}")
else:
print(f"✗ 文件不存在:{file_path}")
# 读取当前的resumeInterviewMock.js
mock_file_path = "src/mocks/resumeInterviewMock.js"
with open(mock_file_path, 'r', encoding='utf-8') as f:
content = f.read()
# 查找resumeTemplates的开始和结束位置
templates_start = content.find("const resumeTemplates = {")
templates_end = content.find("};", templates_start) + 2
if templates_start == -1 or templates_end == -1:
print("错误找不到resumeTemplates定义")
exit(1)
# 提取resumeTemplates部分
templates_section = content[templates_start:templates_end]
# 为每个岗位更新modified字段
for position, modified_content in modified_resumes.items():
print(f"\n更新岗位:{position}")
# 查找该岗位的content对象
position_pattern = f'"position": "{position}"'
pos = templates_section.find(position_pattern)
if pos == -1:
print(f" 警告:找不到岗位 {position}")
continue
# 找到该岗位的content对象
content_start = templates_section.find('"content": {', pos)
if content_start == -1:
print(f" 警告:找不到岗位 {position} 的content字段")
continue
# 找到modified字段的开始位置
modified_start = templates_section.find('"modified":', content_start)
if modified_start == -1:
print(f" 警告:找不到岗位 {position} 的modified字段")
continue
# 找到modified字段值的开始跳过 "modified": 和空格)
value_start = templates_section.find('"', modified_start + len('"modified":'))
# 找到modified字段值的结束找到对应的结束引号
# 需要处理转义的引号
value_end = value_start + 1
while value_end < len(templates_section):
if templates_section[value_end] == '"' and templates_section[value_end-1] != '\\':
break
value_end += 1
# 替换modified字段的值
escaped_content = json.dumps(modified_content, ensure_ascii=False)
new_modified = f'"modified": {escaped_content}'
old_modified = templates_section[modified_start:value_end+1]
templates_section = templates_section.replace(old_modified, new_modified)
print(f" ✓ 已更新modified字段")
# 重新组合完整文件内容
new_content = content[:templates_start] + templates_section + content[templates_end:]
# 写入更新后的内容
with open(mock_file_path, 'w', encoding='utf-8') as f:
f.write(new_content)
print("\n✅ 所有修改版简历已成功更新!")
print(f"更新了 {len(modified_resumes)} 个岗位的修改版简历")