feat: 目标和问题统一分类体系(综合/乐理相关/演奏能力/其他),添加数据库迁移
This commit is contained in:
+4
-1
@@ -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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user