Search in sources :

Example 1 with WholeNetConsensusInfoDTO

use of io.nuls.rpc.resources.dto.WholeNetConsensusInfoDTO in project nuls by nuls-io.

the class PocConsensusResource method getWholeInfo.

@GET
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation("Get the whole network consensus infomation!")
public RpcResult getWholeInfo() {
    RpcResult result = RpcResult.getSuccess();
    WholeNetConsensusInfoDTO dto = new WholeNetConsensusInfoDTO();
    Map<String, Object> map = this.consensusService.getConsensusInfo();
    dto.setAgentCount((Integer) map.get("agentCount"));
    dto.setRewardOfDay((Long) map.get("rewardOfDay"));
    dto.setTotalDeposit((Long) map.get("totalDeposit"));
    dto.setConsensusAccountNumber((Integer) map.get("memberCount"));
    result.setData(dto);
    return result;
}
Also used : WholeNetConsensusInfoDTO(io.nuls.rpc.resources.dto.WholeNetConsensusInfoDTO) RpcResult(io.nuls.rpc.entity.RpcResult) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

RpcResult (io.nuls.rpc.entity.RpcResult)1 WholeNetConsensusInfoDTO (io.nuls.rpc.resources.dto.WholeNetConsensusInfoDTO)1 ApiOperation (io.swagger.annotations.ApiOperation)1