Commit 800eadd2 authored by confusion's avatar confusion

修改删除接口

parent 2ebcf40a
...@@ -311,17 +311,18 @@ async def query_bill( ...@@ -311,17 +311,18 @@ async def query_bill(
return response return response
@router.delete('/{fund_id}/', @router.delete('/{bill_id}/',
tags=["删除"], tags=["删除"],
response_model=Response, response_model=Response,
summary='删除账单记录', summary='删除账单记录',
description='删除账单记录') description='删除账单记录')
async def query_bill( async def query_bill(
fund_id: str, fund_id: str,
bill_id: str,
bill_type: BillType, bill_type: BillType,
bill_collect: AgnosticCollection = Depends(get_bill_collect), bill_collect: AgnosticCollection = Depends(get_bill_collect),
user: User = Depends(get_current_user) user: User = Depends(get_current_user)
): ):
query = {"fund_id": fund_id, "user_id": user.id, "bill_type": bill_type} query = {"fund_id": fund_id, "user_id": user.id, "bill_type": bill_type, "id": bill_id}
await bill_collect.delete_one(query) await bill_collect.delete_one(query)
return Response() return Response()
...@@ -73,11 +73,12 @@ class CreateStakingBill(BaseModel): ...@@ -73,11 +73,12 @@ class CreateStakingBill(BaseModel):
fund_id: str = Field(None, description='基金id') fund_id: str = Field(None, description='基金id')
currency: str = Field(default="ETH", description='币种') currency: str = Field(default="ETH", description='币种')
volume: float = Field(default=32, description='数量') volume: float = Field(default=32, description='数量')
record_time: str = Field(default_factory=lambda: str(datetime.datetime.utcnow().date()), description='记录时间') pub_key: str = Field(..., description='节点key')
# record_time: str = Field(default_factory=lambda: str(datetime.datetime.utcnow().date()), description='记录时间')
remark: str = Field(default="", description="备注") remark: str = Field(default="", description="备注")
class StakingBill(BaseCreateModel): class StakingBill(CreateStakingBill, BaseCreateModel):
"""质押账目""" """质押账目"""
user_id: str user_id: str
bill_type: BillType = Field(default=BillType.staking, description='账目类型') bill_type: BillType = Field(default=BillType.staking, description='账目类型')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment