锁仓上限改为可配置,默认3次不变,止盈按钮左侧增加修改入口
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user