use of com.jd.blockchain.gateway.service.search.Transaction in project jdchain-core by blockchain-jd-com.
the class DataSearchServiceHandler method searchAll.
@Override
public Map<String, Object> searchAll(HashDigest ledgerHash, String keyword) {
Map<String, Object> data = new HashMap<>();
data.put("combine", true);
// 区块
LedgerBlock block = searchBlock(ledgerHash, keyword);
if (null != block) {
data.put("blocks", new LedgerBlock[] { block });
}
// 交易
Transaction tx = searchTransaction(ledgerHash, keyword);
if (null != tx) {
data.put("txs", new Transaction[] { tx });
}
// 数据账户
DataAccountInfo dataAccount = searchDataAccount(ledgerHash, keyword);
if (null != dataAccount) {
data.put("accounts", new DataAccountInfo[] { dataAccount });
}
// 事件账户
BlockchainIdentity eventAccount = searchEventAccount(ledgerHash, keyword);
if (null != eventAccount) {
data.put("event_accounts", new BlockchainIdentity[] { eventAccount });
}
// 合约
ContractInfo contract = searchContractAccount(ledgerHash, keyword);
if (null != contract) {
data.put("contracts", new ContractInfo[] { contract });
}
// 用户
UserInfo user = searchUser(ledgerHash, keyword);
if (null != user) {
data.put("users", new UserInfo[] { user });
}
return data;
}
Aggregations