Remove contract profile from navigation and retire its routes.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -45,7 +45,6 @@ from fee_specs import (
|
||||
purge_non_ctp_fee_rates,
|
||||
)
|
||||
from nav_settings import NAV_TOGGLES, get_nav_items, nav_enabled, save_nav_items
|
||||
from contract_profile import get_contract_profile
|
||||
from stats_engine import STATS_VIEWS, load_stats_cache, refresh_stats_cache
|
||||
from kline_store import ensure_kline_tables
|
||||
from kline_stream import kline_hub, sse_format
|
||||
@@ -1601,40 +1600,14 @@ def api_market_quote():
|
||||
|
||||
@app.route("/contract")
|
||||
@login_required
|
||||
@require_nav("contract")
|
||||
def contract_profile_page():
|
||||
symbol = request.args.get("symbol", "").strip()
|
||||
profile = None
|
||||
error = None
|
||||
if symbol:
|
||||
try:
|
||||
profile = get_contract_profile(symbol)
|
||||
if not profile:
|
||||
error = "未查询到该合约简介,请检查合约代码"
|
||||
except Exception as exc:
|
||||
app.logger.warning("contract profile failed: %s", exc)
|
||||
error = f"查询失败:{exc}"
|
||||
return render_template(
|
||||
"contract.html",
|
||||
symbol=symbol,
|
||||
profile=profile,
|
||||
error=error,
|
||||
)
|
||||
return redirect(url_for("positions"))
|
||||
|
||||
|
||||
@app.route("/api/contract_profile")
|
||||
@login_required
|
||||
def api_contract_profile():
|
||||
symbol = request.args.get("symbol", "").strip()
|
||||
if not symbol:
|
||||
return jsonify({"error": "请提供合约代码"}), 400
|
||||
try:
|
||||
profile = get_contract_profile(symbol)
|
||||
except Exception as exc:
|
||||
return jsonify({"error": str(exc)}), 500
|
||||
if not profile:
|
||||
return jsonify({"error": "未查询到合约简介"}), 404
|
||||
return jsonify(profile)
|
||||
return jsonify({"error": "品种简介功能已移除"}), 404
|
||||
|
||||
|
||||
@app.route("/fees", methods=["GET", "POST"])
|
||||
|
||||
Reference in New Issue
Block a user