feat: 添加学员目标API和目标管理页面

This commit is contained in:
hmo
2026-04-23 20:29:28 +08:00
parent 9f22717adc
commit 6b787bc9c9
3 changed files with 256 additions and 2 deletions
+10 -2
View File
@@ -1,9 +1,17 @@
from flask import Blueprint, request, jsonify
from flask import Blueprint, request, jsonify, render_template
from app.models import db, Goal
from app.routes.auth import login_required_json
from app.routes.auth import login_required_json, admin_required
from app.routes import main_bp
goals_bp = Blueprint("goals", __name__)
# 目标管理页面路由
@main_bp.route("/goals")
@admin_required
def goals_page():
"""目标管理页面"""
return render_template("goals.html", active_nav="goals")
@goals_bp.route("/api/goals", methods=["GET"])
@login_required_json
def get_goals():