Commit 9732a72c authored by jianhua.zhang's avatar jianhua.zhang

毫秒时间转换成秒

parent fe3aaee6
......@@ -76,7 +76,10 @@ public class TransactionControllerV1 {
BlockInfoModel model = BlockInfoModel.getInstance();
if (blockHeader != null) {
model.setNumber(blockHeader.getNumber());
model.setTimestamp(blockHeader.getTimestamp().toString());
if (blockHeader.getTimestamp() != null) {
Long tt = blockHeader.getTimestamp()/1000;
model.setTimestamp(tt.toString());
}
model.setParentHash(blockHeader.getParentHash());
model.setTrans_number(blockHeader.getTransactionVolume());
model.setSize(blockHeader.getBlockBytes());
......@@ -124,7 +127,11 @@ public class TransactionControllerV1 {
} else {
model.setTo(trans.getToAddress());
}
model.setTimestamp(trans.getTimestamp().toString());
if (trans.getTimestamp() != null) {
Long tt = trans.getTimestamp()/1000;
model.setTimestamp(tt.toString());
}
}
return ResponseKit.success(model);
}
......@@ -169,7 +176,10 @@ public class TransactionControllerV1 {
pageInfo.getList().forEach(o -> {
BlockInfoModel model = BlockInfoModel.getInstance();
model.setNumber(o.getNumber());
model.setTimestamp(o.getTimestamp().toString());
if (o.getTimestamp() != null) {
Long tt = o.getTimestamp()/1000;
model.setTimestamp(tt.toString());
}
model.setParentHash(o.getParentHash());
model.setHash(o.getBlockId());
model.setTrans_number(o.getTransactionVolume());
......@@ -230,7 +240,11 @@ public class TransactionControllerV1 {
} else {
model.setTo(o.getToAddress());
}
model.setTimestamp(o.getTimestamp().toString());
if (o.getTimestamp() != null) {
Long tt = o.getTimestamp()/1000;
model.setTimestamp(tt.toString());
}
modelList.add(model);
numberList.add(o.getNumber());
});
......@@ -252,7 +266,10 @@ public class TransactionControllerV1 {
BlockInfoModel model = BlockInfoModel.getInstance();
if (blockHeader != null) {
model.setNumber(blockHeader.getNumber());
model.setTimestamp(blockHeader.getTimestamp().toString());
if (blockHeader.getTimestamp() != null) {
Long tt = blockHeader.getTimestamp()/1000;
model.setTimestamp(tt.toString());
}
model.setParentHash(blockHeader.getParentHash());
model.setTrans_number(blockHeader.getTransactionVolume());
model.setSize(blockHeader.getBlockBytes());
......@@ -321,7 +338,11 @@ public class TransactionControllerV1 {
} else {
model.setTo(trans.getToAddress());
}
model.setTimestamp(trans.getTimestamp().toString());
if (trans.getTimestamp() != null) {
Long tt = trans.getTimestamp()/1000;
model.setTimestamp(tt.toString());
}
}
return ResponseKit.success(model);
......
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