想象一下我有
// execute requests to sub modules in parallel
final CountDownLatch cdl = new CountDownLatch(2);
final List<Throwable> failures = new ArrayList<>();
// load customer information
final Observable<CustomerDTO> customerObservable = customerRxClient.loadCustomer(customerId);
customerObservable
.doOnError(throwable -> {
log.error("Failed to retrieve customer {} information for the reservation {}", customerId, reservationId, throwable);
cdl.countDown();
failures.add(throwable);
})
.doOnCompleted(cdl::countDown)
.subscribe(customer -> {
dto.getReservationOwner().setBirthday(customer.getBirthday());
dto.getReservationOwner().setCustomerId(customer.getCustomerId());
dto.getReservationOwner().setCitizenship(customer.getCitizenship());
dto.getReservationOwner().setEmail(customer.getEmail());
dto.getReservationOwner().setFirstName(customer.getFirstName());
dto.getReservationOwner().setGender(customer.getGender());
dto.getReservationOwner().setLastName(customer.getLastName());
dto.getReservationOwner().setPhone(ofNullable(customer.getPhone()).map(v -> mappingService.map(v, PhoneDTO.class)).orElse(null));
});
// load tickets
final Observable<List<TicketDTO>> ticketsObservable = ticketsClient.getTickets(reservationId);
ticketsObservable
.doOnError(throwable -> {
log.error("Failed to retrieve tickets for the reservation {}", reservationId, throwable);
cdl.countDown();
failures.add(throwable);
})
.doOnCompleted(cdl::countDown)
.subscribe(tickets -> dto.setTickets(tickets.stream()
.map(ticket -> ReservationDTO.TicketDTO.builder()
.guestSeqN(ticket.getGuestSeqN())
.qr(ticket.getQr())
.qrText(ticket.getQrText())
.usedAt(ticket.getUsedAt())
.build())
.collect(toList())));
try {
cdl.await();
} catch (InterruptedException _ignore) {
log.debug("Count down latch has been interrupted!", _ignore);
}
if (!failures.isEmpty()) {
throw new HystrixBadRequestException("Request to submodule has been failed");
}
return dto;
我想选择最后一个。
我试过了<body>
<iframe src=""></iframe>
<iframe src=""></iframe>
</body>
,但它没有用。知道怎么做吗?
答案 0 :(得分:1)
应该是
iframe:last-of-type { ... }