I'm fairly new to Spring Reactive.
I want to transform a Spring Reactive Repo Flux response into a Mono type response of another type:
@Transactional(readOnly = true)
@Override
public Mono<BaseListResponseVm<AcsTransactionVm>> transactionsBy(
@NonNull Integer offset,
@NonNull Integer limit,
@NonNull String term,
AcsTransactionRequestDto dto
) {
var response = new BaseListResponseVm<AcsTransactionVm>();
var list = repository.findByPan(term, PageRequest.of(offset, limit));
return repository.findByPan(term, PageRequest.of(offset, limit))
XXXXX.(res -> {
response.setItems(); // List<AcsTransactionVm>
response.setCount(); // Long
});
}
Repository
public interface AcsTransactionRepository extends ReactiveCassandraRepository<AcsTransactionDao, Integer> {
@AllowFiltering
Flux<AcsTransactionDao> findByPan(String term, Pageable page);
}
I've tried the operators that are provided (transform being the closes that I need, but still it provides every single param of the repo result as reactive one), but couldn't end up with anything that I would know how how to use.