update question

This commit is contained in:
2025-07-10 05:48:23 +08:00
parent f8702ac1b9
commit 9c49adbaf1
7 changed files with 55 additions and 11 deletions

View File

@ -5,16 +5,18 @@ from pydantic import BaseModel
class Transfer(BaseModel):
amount: int
sender: int
receiver: int
sender: str
receiver: str
app = FastAPI()
accounts = {
'1': {'amount': 1000},
'2': {'amount': 1000},
'1': 1000,
'2': 1000,
}
transactions: list[Transfer] = []
@app.post("/transfer")
def transfer(transfer: Transfer):
amount = transfer.amount