| 12345678910111213141516171819202122232425262728293031323334 |
- import json
- from app import create_app, db
- from app.models import PageContent
- app = create_app()
- with app.app_context():
- education_data = {
- "banner": {
- "title": "助力高校AI + 内涵建设",
- "subtitle": "推动 AI 技术与专业教学深度融合,提升院校学科建设与人才培养质量",
- "bg_image_url": "", # 新增背景图字段
- "image_url": "https://images.unsplash.com/photo-1531482615713-2afd69097998?q=80&w=2070&auto=format&fit=crop"
- },
- "features": [
- { "icon": "School", "icon_url": "", "title": "教学", "subtitle": "人工智能培育" },
- { "icon": "OfficeBuilding", "icon_url": "", "title": "实训", "subtitle": "训战一体化" },
- { "icon": "DataLine", "icon_url": "", "title": "科研", "subtitle": "训战一体化" }
- ]
- }
-
- existing = PageContent.query.filter_by(page_key='education').first()
- if existing:
- existing.content = json.dumps(education_data, ensure_ascii=False)
- else:
- new_page = PageContent(
- page_key='education',
- page_name='产教融合',
- content=json.dumps(education_data, ensure_ascii=False)
- )
- db.session.add(new_page)
-
- db.session.commit()
- print("Education page data seeded successfully.")
|