Files
jiaowu-test/extract_minsu_data.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

50 lines
1.4 KiB
Python

#!/usr/bin/env python3
import json
import re
# 读取文件
with open('src/mocks/resumeInterviewMock.js', 'r', encoding='utf-8') as f:
content = f.read()
# 找到民宿经营的interviews数据
start_pattern = r'"民宿经营": \['
end_pattern = r'\]\s*,\s*"文创品牌运营"'
match = re.search(f'{start_pattern}(.*?){end_pattern}', content, re.DOTALL)
if not match:
print("未找到民宿经营数据")
exit(1)
minsu_data = match.group(1)
# 提取每个岗位的数据
positions = []
pattern = r'\{\s*position:\s*"([^"]+)".*?studentInfo:\s*(\{[^}]*(?:\{[^}]*\}[^}]*)*\})'
matches = re.finditer(pattern, minsu_data, re.DOTALL)
for match in matches:
position_name = match.group(1)
student_info = match.group(2)
# 只提取前3个岗位作为示例
if len(positions) < 3:
positions.append({
'position': position_name,
'studentInfo': student_info
})
# 生成resumeTemplates格式的代码
output = ' "民宿经营": [\n'
for i, pos in enumerate(positions):
output += f' {{\n'
output += f' position: "{pos["position"]}",\n'
output += f' level: "普通岗",\n'
output += f' studentInfo: {pos["studentInfo"]}\n'
output += f' }}'
if i < len(positions) - 1:
output += ','
output += '\n'
output += ' ],\n'
print("生成的代码片段:")
print(output)