加固管理员解冻:校验落库并返回余额/冻结池变动明细。

解冻接口返回 unfreeze_result,便于后台核对池→余额是否真正写回。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-12 13:15:10 +08:00
parent 59af2fc18a
commit c3bab3564a
2 changed files with 34 additions and 6 deletions

View File

@@ -77,12 +77,20 @@ class DongjieUserConfigView(APIView):
return Response({'code': 400, 'msg': '请填写解冻金额'})
try:
with transaction.atomic():
new_balance = admin_unfreeze_balance(
result = admin_unfreeze_balance(
user_main, leixing, jine,
operator_id=username, beizhu=beizhu,
)
info = get_user_freeze_info(user_main, leixing)
info['balance'] = str(new_balance)
info['balance'] = str(result['balance_after'])
info['dongjie_chi'] = str(result['dongjie_chi_after'])
info['unfreeze_result'] = {
'balance_before': str(result['balance_before']),
'balance_after': str(result['balance_after']),
'dongjie_chi_before': str(result['dongjie_chi_before']),
'dongjie_chi_after': str(result['dongjie_chi_after']),
'unfreeze_jine': str(result['unfreeze_jine']),
}
return Response({'code': 0, 'msg': '解冻成功', 'data': info})
except ValueError as e:
return Response({'code': 400, 'msg': str(e)})