锁仓上限改为可配置,默认3次不变,止盈按钮左侧增加修改入口

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
fish
2026-07-27 12:57:34 +08:00
parent 1a70a60dba
commit 434acb0470
6 changed files with 70 additions and 6 deletions
+13
View File
@@ -139,6 +139,19 @@ def update_lock_price(
return RedirectResponse("/positions/", status_code=303)
@router.post("/{round_id}/max-locks")
def update_max_locks(
round_id: int,
max_locks: int = Form(...),
db: Session = Depends(get_db),
):
r = db.query(Round).filter(Round.id == round_id).first()
if r and r.status == "active" and 1 <= max_locks <= 10:
r.max_locks = max_locks
db.commit()
return RedirectResponse("/positions/", status_code=303)
@router.post("/{round_id}/close")
def close_round(
request: Request,