use of com.jd.blockchain.ledger.LedgerInfo in project jdchain-core by blockchain-jd-com.
the class LedgerQueryController method getLedger.
@RequestMapping(method = RequestMethod.GET, path = GET_LEDGER)
@Override
public LedgerInfo getLedger(@PathVariable(name = "ledgerHash") HashDigest ledgerHash) {
LedgerQuery ledger = ledgerService.getLedger(ledgerHash);
// TODO: 需要配置返回值的 spring MsgQueueMessageDispatcher
// ,对返回对象仅仅序列化声明的返回值类型的属性,而不是整个对象本身;
LedgerInfo ledgerInfo = new LedgerInfo();
ledgerInfo.setHash(ledgerHash);
ledgerInfo.setLatestBlockHash(ledger.getLatestBlockHash());
ledgerInfo.setLatestBlockHeight(ledger.getLatestBlockHeight());
return ledgerInfo;
}
Aggregations