Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PyFund
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈涛
PyFund
Commits
50e36891
Commit
50e36891
authored
Mar 26, 2023
by
杨明橙
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/main'
parents
1eb4322f
341c9928
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
bill.py
model/bill.py
+18
-0
No files found.
model/bill.py
View file @
50e36891
import
datetime
from
enum
import
Enum
from
typing
import
List
,
Optional
...
...
@@ -29,6 +30,9 @@ class CreatePCFBill(BaseModel):
currency
:
str
=
Field
(
None
,
description
=
'币种'
)
volume
:
float
=
Field
(
...
,
description
=
'资产数量'
)
price
:
float
=
Field
(
None
,
description
=
"价格"
)
# record_time: datetime.date = Field(default_factory=lambda: datetime.datetime.utcnow().date(), description='记录时间')
record_time
:
str
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
str
=
Field
(
default
=
""
,
description
=
"备注"
)
# 传入数据库类型 / 接口返回类型
...
...
@@ -48,6 +52,8 @@ class CreateExchangeBill(BaseModel):
output_currency
:
str
=
Field
(
...
,
description
=
"输出币种"
)
output_price
:
float
=
Field
(
...
,
description
=
"输出币种价格"
)
output_volume
:
float
=
Field
(
...
,
description
=
"输出数量"
)
record_time
:
str
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
str
=
Field
(
default
=
""
,
description
=
"备注"
)
class
ExchangeBill
(
CreateExchangeBill
,
BaseCreateModel
):
...
...
@@ -63,6 +69,8 @@ class CreateStaking(BaseModel):
fund_id
:
str
=
Field
(
None
,
description
=
'基金id'
)
currency
:
str
=
Field
(
default
=
"ETH"
,
description
=
'币种'
)
volume
:
float
=
Field
(
...
,
description
=
'数量'
)
record_time
:
str
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
str
=
Field
(
default
=
""
,
description
=
"备注"
)
class
StakingBill
(
BaseCreateModel
):
...
...
@@ -76,6 +84,8 @@ class CreateAdjustBill(BaseModel):
currency
:
str
=
Field
(
None
,
description
=
'币种'
)
volume
:
float
=
Field
(
...
,
description
=
'资产数量'
)
price
:
float
=
Field
(
None
,
description
=
"价格"
)
record_time
:
str
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
str
=
Field
(
default
=
""
,
description
=
"备注"
)
class
AdjustBill
(
CreateAdjustBill
,
BaseCreateModel
):
...
...
@@ -91,6 +101,8 @@ class UpdatePCFBill(BaseModel):
price
:
Optional
[
float
]
=
Field
(
None
,
description
=
"价格"
)
fund_share
:
Optional
[
float
]
=
Field
(
None
,
description
=
"基金份额"
)
market_value
:
Optional
[
float
]
=
Field
(
None
,
description
=
"市值"
)
record_time
:
str
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
str
=
Field
(
default
=
""
,
description
=
"备注"
)
class
Config
:
orm_mode
=
True
...
...
@@ -103,6 +115,8 @@ class UpdateExchangeBill(BaseModel):
output_currency
:
Optional
[
str
]
=
Field
(
None
,
description
=
"输出币种"
)
output_price
:
Optional
[
float
]
=
Field
(
None
,
description
=
"输出币种价格"
)
output_volume
:
Optional
[
float
]
=
Field
(
None
,
description
=
"输出数量"
)
record_time
:
str
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
str
=
Field
(
default
=
""
,
description
=
"备注"
)
class
Config
:
orm_mode
=
True
...
...
@@ -112,6 +126,8 @@ class UpdateStakingBill(BaseModel):
currency
:
Optional
[
str
]
=
Field
(
default
=
"ETH"
,
description
=
'币种'
)
volume
:
Optional
[
float
]
=
Field
(
None
,
description
=
'数量'
)
price
:
float
=
Field
(
None
,
description
=
"价格"
)
record_time
:
str
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
str
=
Field
(
default
=
""
,
description
=
"备注"
)
class
Config
:
orm_mode
=
True
...
...
@@ -121,6 +137,8 @@ class UpdateAdjustBill(BaseModel):
currency
:
Optional
[
str
]
=
Field
(
None
,
description
=
'币种'
)
volume
:
Optional
[
float
]
=
Field
(
None
,
description
=
'资产数量'
)
price
:
Optional
[
float
]
=
Field
(
None
,
description
=
"价格"
)
record_time
:
str
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
str
=
Field
(
default
=
""
,
description
=
"备注"
)
class
Config
:
orm_mode
=
True
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment