Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tron-explore
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
张建华@五瓣科技
tron-explore
Commits
a54d2be2
Commit
a54d2be2
authored
Nov 17, 2020
by
jianhua.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
账户地址获取交易列表接口调整
parent
c9b75fef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
README.md
README.md
+6
-1
TransactionControllerV1.java
...n/tron/explore/controller/v1/TransactionControllerV1.java
+6
-5
TronServiceImpl.java
.../com/wuban/tron/explore/service/impl/TronServiceImpl.java
+4
-4
No files found.
README.md
View file @
a54d2be2
...
@@ -4,4 +4,9 @@
...
@@ -4,4 +4,9 @@
1.
项目根目录下tron-explore.sql文件
1.
项目根目录下tron-explore.sql文件
二. 项目启动程序
二. 项目启动程序
1.
com.wuban.tron.explore.ExploreApplication
1.
com.wuban.tron.explore.ExploreApplication
\ No newline at end of file
2.
数据抓取地址在配置文件application-dev.yml等文件中调整
tron:
site: https://api.shasta.trongrid.io
\ No newline at end of file
src/main/java/com/wuban/tron/explore/controller/v1/TransactionControllerV1.java
View file @
a54d2be2
...
@@ -353,15 +353,16 @@ public class TransactionControllerV1 {
...
@@ -353,15 +353,16 @@ public class TransactionControllerV1 {
*/
*/
@RequestMapping
(
value
=
"getTxInfoByAddress/{address}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"getTxInfoByAddress/{address}"
,
method
=
RequestMethod
.
GET
)
public
ApiResponse
getTxInfoByAddress
(
@PathVariable
(
"address"
)
String
address
)
{
public
ApiResponse
getTxInfoByAddress
(
@PathVariable
(
"address"
)
String
address
)
{
ResDataModel
<
TransInfoModel
>
resDataModel
=
new
ResDataModel
<>();
//
ResDataModel<TransInfoModel> resDataModel = new ResDataModel<>();
PageInfo
<
Transaction
>
pageInfo
=
this
.
transactionService
.
selectPageByAddress
(
address
,
1
,
25
);
PageInfo
<
Transaction
>
pageInfo
=
this
.
transactionService
.
selectPageByAddress
(
address
,
1
,
25
);
List
<
TransInfoModel
>
modelList
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
pageInfo
.
getList
()))
{
if
(!
CollectionUtils
.
isEmpty
(
pageInfo
.
getList
()))
{
List
<
TransInfoModel
>
modelList
=
transferTransInfoModel
(
pageInfo
);
modelList
=
transferTransInfoModel
(
pageInfo
);
resDataModel
.
setTotal
(
Integer
.
valueOf
(
pageInfo
.
getTotal
()+
""
));
//
resDataModel.setTotal(Integer.valueOf(pageInfo.getTotal()+""));
resDataModel
.
setData
(
modelList
);
//
resDataModel.setData(modelList);
}
}
return
ResponseKit
.
success
(
resDataModel
);
return
ResponseKit
.
success
(
modelList
);
}
}
/**
/**
...
...
src/main/java/com/wuban/tron/explore/service/impl/TronServiceImpl.java
View file @
a54d2be2
...
@@ -24,7 +24,7 @@ public class TronServiceImpl extends BaseCommonService implements TronService {
...
@@ -24,7 +24,7 @@ public class TronServiceImpl extends BaseCommonService implements TronService {
@Override
@Override
public
TronResponseData
getBlockByNum
(
Long
blockNum
)
{
public
TronResponseData
getBlockByNum
(
Long
blockNum
)
{
String
str
=
this
.
analysisBlock
(
blockNum
);
String
str
=
this
.
analysisBlock
(
GET_BLOCK_BYNUM
,
blockNum
);
if
(
StringUtils
.
isEmpty
(
str
))
{
if
(
StringUtils
.
isEmpty
(
str
))
{
return
null
;
return
null
;
}
}
...
@@ -34,7 +34,7 @@ public class TronServiceImpl extends BaseCommonService implements TronService {
...
@@ -34,7 +34,7 @@ public class TronServiceImpl extends BaseCommonService implements TronService {
@Override
@Override
public
TronResponseArrayData
getBlockByLatestNum
(
Integer
num
)
{
public
TronResponseArrayData
getBlockByLatestNum
(
Integer
num
)
{
String
str
=
this
.
analysisBlock
(
num
);
String
str
=
this
.
analysisBlock
(
GET_BLOCK_BYLATESTNUM
,
num
);
if
(
StringUtils
.
isEmpty
(
str
))
{
if
(
StringUtils
.
isEmpty
(
str
))
{
return
null
;
return
null
;
}
}
...
@@ -42,11 +42,11 @@ public class TronServiceImpl extends BaseCommonService implements TronService {
...
@@ -42,11 +42,11 @@ public class TronServiceImpl extends BaseCommonService implements TronService {
return
JSONObject
.
parseObject
(
str
,
TronResponseArrayData
.
class
);
return
JSONObject
.
parseObject
(
str
,
TronResponseArrayData
.
class
);
}
}
private
String
analysisBlock
(
Object
param
)
{
private
String
analysisBlock
(
String
interfaceName
,
Object
param
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
1
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
1
);
map
.
put
(
"num"
,
param
);
map
.
put
(
"num"
,
param
);
Request
request
=
this
.
builder
(
GET_BLOCK_BYNUM
,
map
);
Request
request
=
this
.
builder
(
interfaceName
,
map
);
String
str
=
this
.
execute
(
request
);
String
str
=
this
.
execute
(
request
);
return
str
;
return
str
;
}
}
...
...
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