feat(base): 统一标准响应code为status
This commit is contained in:
@@ -13,7 +13,7 @@ T = TypeVar('T')
|
|||||||
|
|
||||||
|
|
||||||
class BaseResponse(BaseModel, Generic[T]):
|
class BaseResponse(BaseModel, Generic[T]):
|
||||||
code: int = 200
|
status: int = 200
|
||||||
message: str = 'success'
|
message: str = 'success'
|
||||||
data: Optional[T] = None
|
data: Optional[T] = None
|
||||||
|
|
||||||
|
|||||||
@@ -113,10 +113,10 @@ async def wechat_notify(
|
|||||||
'notify_total_fee': params['total_fee'],
|
'notify_total_fee': params['total_fee'],
|
||||||
'status': base_schema.OrderStatusType.OK
|
'status': base_schema.OrderStatusType.OK
|
||||||
})
|
})
|
||||||
result = {'code': 200, 'message': 'OK'}
|
result = {'status': 200, 'message': 'OK'}
|
||||||
background_tasks.add_task(actions_after_payment, notify_params=params)
|
background_tasks.add_task(actions_after_payment, notify_params=params)
|
||||||
else:
|
else:
|
||||||
result = {'code': 400, 'message': '支付失败'}
|
result = {'status': 400, 'message': '支付失败'}
|
||||||
record.update({
|
record.update({
|
||||||
'status': base_schema.OrderStatusType.FAIL,
|
'status': base_schema.OrderStatusType.FAIL,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user