use of io.nuls.rpc.entity.OutputDto in project nuls by nuls-io.
the class TransactionResource method list.
@GET
@Path("/locked")
@Produces(MediaType.APPLICATION_JSON)
public RpcResult list(@QueryParam("address") String address, @QueryParam("pageNumber") int pageNumber, @QueryParam("pageSize") int pageSize) {
if (!Address.validAddress(address)) {
return RpcResult.getFailed(ErrorCode.PARAMETER_ERROR);
}
if (pageNumber < 0 || pageSize < 0) {
return RpcResult.getFailed(ErrorCode.PARAMETER_ERROR);
}
if (pageNumber == 0) {
pageNumber = 1;
}
if (pageSize == 0) {
pageSize = 10;
}
// todo ledgerService.getLockUtxo
List<UtxoOutputPo> poList = outputDataService.getLockUtxo(address, TimeService.currentTimeMillis(), pageNumber, pageSize);
List<OutputDto> dtoList = new ArrayList<>();
for (UtxoOutputPo po : poList) {
dtoList.add(new OutputDto(po));
}
RpcResult result = RpcResult.getSuccess();
result.setData(dtoList);
return result;
}
Aggregations