Files
ALL-teach_sys/frontend_视觉设计/update_all_to_single_card.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.6 KiB
Python
Raw 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
import json
import os
from datetime import datetime
# 读取视觉设计岗位简历.json文件
json_file = '网页未导入数据/视觉设计产业/视觉设计岗位简历.json'
mock_file = 'src/mocks/resumeInterviewMock.js'
print("正在读取所有岗位的面试题...")
with open(json_file, 'r', encoding='utf-8') as f:
positions_data = json.load(f)
# 提取所有岗位的面试题
all_questions = {}
for position in positions_data:
position_name = position.get("岗位名称", "")
interview_content = position.get("面试题内容", "")
if position_name and interview_content:
questions = []
lines = interview_content.split('\n')
for line in lines:
line = line.strip()
if line and line[0].isdigit() and '. 问题' in line:
parts = line.split('问题:', 1)
if len(parts) > 1:
question_text = parts[1].strip()
questions.append(question_text)
all_questions[position_name] = questions
print(f"共解析 {len(all_questions)} 个岗位的面试题")
# 为每个岗位创建单卡片格式的面试题
def generate_single_card_questions(industry_name, questions):
"""生成单卡片格式的面试题JSON"""
result = [
{
"id": "group_q1",
"question": f"# {industry_name}面试题",
"subQuestions": []
}
]
for idx, q in enumerate(questions, 1):
result[0]["subQuestions"].append({
"id": f"q1_{idx}",
"question": q,
"answer": "请根据您的实际经验和项目情况,结合专业知识进行回答。"
})
return json.dumps(result, ensure_ascii=False, indent=6)
# 定义要更新的产业和对应岗位
industry_updates = [
("包装设计", "包装设计师"),
("插画设计", "插画师"),
("灯光", "影视灯光"),
("动画设计", "动画师"),
("后期特效", "特效设计师"),
("剪辑", "剪辑师"),
("品牌设计", "品牌视觉内容策划"),
("平面设计", "平面设计师"),
("三维设计", "3D建模师"),
("摄影/摄像", "摄影师"),
("室内设计", "室内设计师"),
("调色", "调色师"),
("新媒体运营", "新媒体运营专员"),
("音频处理", "音效设计师"),
("影视节目策划", "导演"),
("直播", "直播助理")
]
# 生成所有更新
print("\n生成所有产业的单卡片格式面试题...")
updates_ready = []
for industry_name, position_name in industry_updates:
if position_name in all_questions:
questions = all_questions[position_name]
if questions:
questions_json = generate_single_card_questions(industry_name, questions)
updates_ready.append({
'industry': industry_name,
'questions_json': questions_json,
'count': len(questions)
})
print(f" {industry_name}: {len(questions)} 个问题")
# 保存到文件供手动更新
output_file = 'single_card_questions_updates.json'
with open(output_file, 'w', encoding='utf-8') as f:
json.dump(updates_ready, f, ensure_ascii=False, indent=2)
print(f"\n生成了 {len(updates_ready)} 个产业的单卡片格式面试题")
print(f"数据已保存到 {output_file}")
# 为包装设计生成示例更新代码
if len(updates_ready) > 0:
first_update = updates_ready[0]
print(f"\n包装设计的面试题更新示例:")
print(f"产业:{first_update['industry']}")
print(f"问题数:{first_update['count']}")
print("JSON预览前200字符")
print(first_update['questions_json'][:200] + "...")