Commit a54d2be2 authored by jianhua.zhang's avatar jianhua.zhang

账户地址获取交易列表接口调整

parent c9b75fef
......@@ -5,3 +5,8 @@
二. 项目启动程序
1. com.wuban.tron.explore.ExploreApplication
2. 数据抓取地址在配置文件application-dev.yml等文件中调整
tron:
site: https://api.shasta.trongrid.io
\ No newline at end of file
......@@ -353,15 +353,16 @@ public class TransactionControllerV1 {
*/
@RequestMapping(value="getTxInfoByAddress/{address}", method = RequestMethod.GET)
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);
List<TransInfoModel> modelList = new ArrayList<>();
if (!CollectionUtils.isEmpty(pageInfo.getList())) {
List<TransInfoModel> modelList = transferTransInfoModel(pageInfo);
resDataModel.setTotal(Integer.valueOf(pageInfo.getTotal()+""));
resDataModel.setData(modelList);
modelList = transferTransInfoModel(pageInfo);
//resDataModel.setTotal(Integer.valueOf(pageInfo.getTotal()+""));
//resDataModel.setData(modelList);
}
return ResponseKit.success(resDataModel);
return ResponseKit.success(modelList);
}
/**
......
......@@ -24,7 +24,7 @@ public class TronServiceImpl extends BaseCommonService implements TronService {
@Override
public TronResponseData getBlockByNum(Long blockNum) {
String str = this.analysisBlock(blockNum);
String str = this.analysisBlock(GET_BLOCK_BYNUM, blockNum);
if (StringUtils.isEmpty(str)) {
return null;
}
......@@ -34,7 +34,7 @@ public class TronServiceImpl extends BaseCommonService implements TronService {
@Override
public TronResponseArrayData getBlockByLatestNum(Integer num) {
String str = this.analysisBlock(num);
String str = this.analysisBlock(GET_BLOCK_BYLATESTNUM, num);
if (StringUtils.isEmpty(str)) {
return null;
}
......@@ -42,11 +42,11 @@ public class TronServiceImpl extends BaseCommonService implements TronService {
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.put("num", param);
Request request = this.builder(GET_BLOCK_BYNUM, map);
Request request = this.builder(interfaceName, map);
String str = this.execute(request);
return str;
}
......
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