in alpha/alpha-ui/src/main/java/org/apache/servicecomb/pack/alpha/ui/controller/TransactionController.java [71:96]
public DataTablesResponseDTO sagaList(@ModelAttribute DataTablesRequestDTO dataTablesRequestDTO)
throws Exception {
List<TransactionRowDTO> data = new ArrayList<>();
PagingGlobalTransactions pagingGlobalTransactions = apiv1
.getTransactions(dataTablesRequestDTO.getState(),
dataTablesRequestDTO.getStart() / dataTablesRequestDTO.getLength(),
dataTablesRequestDTO.getLength());
pagingGlobalTransactions.getGlobalTransactions().forEach(globalTransaction -> {
data.add(TransactionRowDTO.builder()
.serviceName(globalTransaction.getServiceName())
.instanceId(globalTransaction.getInstanceId())
.globalTxId(globalTransaction.getGlobalTxId())
.state(globalTransaction.getState())
.beginTime(globalTransaction.getBeginTime())
.endTime(globalTransaction.getEndTime())
.subTxSize(globalTransaction.getSubTxSize())
.durationTime(globalTransaction.getDurationTime())
.build());
});
return DataTablesResponseDTO.builder()
.draw(dataTablesRequestDTO.getDraw())
.recordsTotal(pagingGlobalTransactions.getTotal())
.recordsFiltered(pagingGlobalTransactions.getTotal())
.data(data)
.build();
}