This commit is contained in:
2026-07-30 10:30:50 +08:00
parent cf6d708566
commit 853c478657
85 changed files with 4711 additions and 1052 deletions
+3 -3
View File
@@ -51,7 +51,7 @@ async def create_customer(
customer = Customer(**data)
db_session.add(customer)
await db_session.commit()
await db_session.flush()
await db_session.refresh(customer)
return CustomerResponse.from_orm(customer)
@@ -71,7 +71,7 @@ async def update_customer(
for key, value in customer_data.dict().items():
setattr(customer, key, value)
await db_session.commit()
await db_session.flush()
await db_session.refresh(customer)
return CustomerResponse.from_orm(customer)
@@ -88,5 +88,5 @@ async def delete_customer(
raise HTTPException(status_code=404, detail="客户不存在")
customer.is_active = False
await db_session.commit()
await db_session.flush()
return {"message": "客户已删除"}