feat: 目标和问题统一分类体系(综合/乐理相关/演奏能力/其他),添加数据库迁移

This commit is contained in:
hmo
2026-04-23 21:57:00 +08:00
parent 5f1dcc08fb
commit f83769fa20
4 changed files with 49 additions and 6 deletions
+4 -1
View File
@@ -25,7 +25,8 @@ def create_goal():
goal = Goal(
name=data["name"],
content=data.get("content", ""),
level=data.get("level", "入门")
level=data.get("level", "入门"),
category=data.get("category", "综合")
)
db.session.add(goal)
db.session.commit()
@@ -48,6 +49,8 @@ def update_goal(goal_id):
goal.content = data["content"]
if "level" in data:
goal.level = data["level"]
if "category" in data:
goal.category = data["category"]
db.session.commit()
return jsonify(goal.to_dict())