Search in sources :

Example 1 with LedgerInfo

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;
}
Also used : LedgerInfo(com.jd.blockchain.ledger.LedgerInfo) LedgerQuery(com.jd.blockchain.ledger.core.LedgerQuery) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

LedgerInfo (com.jd.blockchain.ledger.LedgerInfo)1 LedgerQuery (com.jd.blockchain.ledger.core.LedgerQuery)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1