主要内容: - 包含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>
93 lines
3.7 KiB
Python
93 lines
3.7 KiB
Python
#!/usr/bin/env python3
|
||
# -*- coding: utf-8 -*-
|
||
|
||
import os
|
||
import json
|
||
import datetime
|
||
import shutil
|
||
|
||
def main():
|
||
mock_file = "src/mocks/resumeInterviewMock.js"
|
||
|
||
# 备份
|
||
backup_path = f"{mock_file}.backup_{datetime.datetime.now().strftime('%Y%m%d_%H%M%S')}"
|
||
shutil.copy(mock_file, backup_path)
|
||
print(f"✅ 已备份文件到:{backup_path}")
|
||
|
||
# 读取所有修改版简历
|
||
modified_folder = "网页未导入数据/能源产业/能源修改版简历"
|
||
modified_resumes = {}
|
||
|
||
for filename in os.listdir(modified_folder):
|
||
if filename.endswith('.md'):
|
||
position_name = filename.replace('.md', '')
|
||
with open(os.path.join(modified_folder, filename), 'r', encoding='utf-8') as f:
|
||
modified_resumes[position_name] = f.read()
|
||
|
||
print(f"📚 读取到 {len(modified_resumes)} 个修改版简历")
|
||
|
||
# 读取mock文件
|
||
with open(mock_file, 'r', encoding='utf-8') as f:
|
||
content = f.read()
|
||
|
||
# 对每个岗位进行处理
|
||
updated_count = 0
|
||
for position_name, resume_content in modified_resumes.items():
|
||
print(f"处理: {position_name}")
|
||
|
||
# 处理特殊情况:电池pack测试工程师(小写)
|
||
search_name = position_name
|
||
if position_name == "电池PACK测试工程师":
|
||
search_name = "电池pack测试工程师"
|
||
|
||
# 查找该岗位在resumeTemplates中的位置
|
||
search_str = f'"position": "{search_name}"'
|
||
idx = content.find(search_str)
|
||
|
||
if idx > 0:
|
||
# 找到该岗位后,查找其content对象
|
||
content_idx = content.find('"content": {', idx)
|
||
if content_idx > idx and content_idx - idx < 500: # 确保是同一个对象
|
||
# 查找original字段的结束位置
|
||
original_end_idx = content.find('"original": "', content_idx)
|
||
if original_end_idx > 0:
|
||
# 找到original值的结束位置
|
||
quote_idx = content_idx
|
||
count = 0
|
||
in_string = False
|
||
escape_next = False
|
||
|
||
# 从original开始查找其结束位置
|
||
for i in range(original_end_idx + 13, len(content)):
|
||
if escape_next:
|
||
escape_next = False
|
||
continue
|
||
if content[i] == '\\':
|
||
escape_next = True
|
||
continue
|
||
if content[i] == '"':
|
||
# 找到original值的结束引号
|
||
# 检查后面是否已有modified字段
|
||
check_str = content[i:i+100]
|
||
if '"modified":' not in check_str:
|
||
# 添加modified字段
|
||
escaped_resume = json.dumps(resume_content, ensure_ascii=False)
|
||
insert_str = f',\n "modified": {escaped_resume}'
|
||
content = content[:i+1] + insert_str + content[i+1:]
|
||
updated_count += 1
|
||
print(f" ✅ 已添加修改版")
|
||
else:
|
||
print(f" ⚠️ 已存在modified字段")
|
||
break
|
||
else:
|
||
print(f" ❌ 未找到该岗位")
|
||
|
||
# 写回文件
|
||
with open(mock_file, 'w', encoding='utf-8') as f:
|
||
f.write(content)
|
||
|
||
print(f"\n✅ 成功更新 {updated_count}/{len(modified_resumes)} 个岗位")
|
||
|
||
if __name__ == "__main__":
|
||
main()
|