Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
link33
plugin
Commits
bb1aa4b8
Commit
bb1aa4b8
authored
Nov 11, 2019
by
pengjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#627 add borrow record to collateralize info query
parent
172ed60e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
14 deletions
+23
-14
query.go
plugin/dapp/collateralize/executor/query.go
+12
-4
collateralize.proto
plugin/dapp/collateralize/proto/collateralize.proto
+11
-10
collateralize.pb.go
plugin/dapp/collateralize/types/collateralize.pb.go
+0
-0
No files found.
plugin/dapp/collateralize/executor/query.go
View file @
bb1aa4b8
...
...
@@ -16,7 +16,7 @@ func (c *Collateralize) Query_CollateralizeInfoByID(req *pty.ReqCollateralizeInf
return
nil
,
err
}
return
&
pty
.
RepCollateralizeCurrentInfo
{
info
:=
&
pty
.
RepCollateralizeCurrentInfo
{
Status
:
coll
.
Status
,
TotalBalance
:
coll
.
TotalBalance
,
DebtCeiling
:
coll
.
DebtCeiling
,
...
...
@@ -27,7 +27,11 @@ func (c *Collateralize) Query_CollateralizeInfoByID(req *pty.ReqCollateralizeInf
Period
:
coll
.
Period
,
CollateralizeId
:
coll
.
CollateralizeId
,
CollBalance
:
coll
.
CollBalance
,
},
nil
}
info
.
BorrowRecords
=
append
(
info
.
BorrowRecords
,
coll
.
BorrowRecords
...
)
info
.
BorrowRecords
=
append
(
info
.
BorrowRecords
,
coll
.
InvalidRecords
...
)
return
info
,
nil
}
func
(
c
*
Collateralize
)
Query_CollateralizeInfoByIDs
(
req
*
pty
.
ReqCollateralizeInfos
)
(
types
.
Message
,
error
)
{
...
...
@@ -39,7 +43,7 @@ func (c *Collateralize) Query_CollateralizeInfoByIDs(req *pty.ReqCollateralizeIn
return
nil
,
err
}
info
s
.
Infos
=
append
(
infos
.
Infos
,
&
pty
.
RepCollateralizeCurrentInfo
{
info
:=
&
pty
.
RepCollateralizeCurrentInfo
{
Status
:
coll
.
Status
,
TotalBalance
:
coll
.
TotalBalance
,
DebtCeiling
:
coll
.
DebtCeiling
,
...
...
@@ -50,7 +54,11 @@ func (c *Collateralize) Query_CollateralizeInfoByIDs(req *pty.ReqCollateralizeIn
Period
:
coll
.
Period
,
CollateralizeId
:
coll
.
CollateralizeId
,
CollBalance
:
coll
.
CollBalance
,
})
}
info
.
BorrowRecords
=
append
(
info
.
BorrowRecords
,
coll
.
BorrowRecords
...
)
info
.
BorrowRecords
=
append
(
info
.
BorrowRecords
,
coll
.
InvalidRecords
...
)
infos
.
Infos
=
append
(
infos
.
Infos
,
info
)
}
return
infos
,
nil
...
...
plugin/dapp/collateralize/proto/collateralize.proto
View file @
bb1aa4b8
...
...
@@ -143,16 +143,17 @@ message ReqCollateralizeInfo {
// 返回一期放贷信息
message
RepCollateralizeCurrentInfo
{
int32
status
=
1
;
//当期借贷的状态,是否关闭
int64
totalBalance
=
2
;
//当期可借贷的总金额(ccny)
int64
debtCeiling
=
3
;
//单用户可借出的限额(ccny)
float
liquidationRatio
=
4
;
//清算比例
float
stabilityFeeRatio
=
5
;
//稳定费
string
createAddr
=
6
;
//创建人地址
int64
balance
=
7
;
//剩余可借贷金额(ccny)
int64
period
=
8
;
//合约期限
string
collateralizeId
=
9
;
//放贷ID
int64
collBalance
=
10
;
//抵押bty
int32
status
=
1
;
//当期借贷的状态,是否关闭
int64
totalBalance
=
2
;
//当期可借贷的总金额(ccny)
int64
debtCeiling
=
3
;
//单用户可借出的限额(ccny)
float
liquidationRatio
=
4
;
//清算比例
float
stabilityFeeRatio
=
5
;
//稳定费
string
createAddr
=
6
;
//创建人地址
int64
balance
=
7
;
//剩余可借贷金额(ccny)
int64
period
=
8
;
//合约期限
string
collateralizeId
=
9
;
//放贷ID
int64
collBalance
=
10
;
//抵押bty
repeated
BorrowRecord
borrowRecords
=
11
;
//借贷记录
}
// 根据ID列表查询多期放贷信息
...
...
plugin/dapp/collateralize/types/collateralize.pb.go
View file @
bb1aa4b8
This diff is collapsed.
Click to expand it.
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