Я хочу преобразовать страницу в страницу
, поэтому я реализовал вот так
@GetMapping("/history")
public Page<ResponseAllHistoryDto> getAllHistory() {
Pageable pageable = PageRequest.of(0, 20, Sort.by("createdAt"));
Page<History> histories = historyRepository.findAll(pageable);
return histories.map(history -> {
return ResponseAllHistoryDto.builder()
.history(history)
.tags(tagRepository.findByHistoryHistoryId(history.getHistoryId()))
.auths(authRepository.findByHistoryHistoryId(history.getHistoryId()))
.build();
});
}
К сожалению.Это дает мне
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class com.wrapsody.demo.ResponseAllHistoryDto and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.springframework.data.domain.PageImpl["content"]->java.util.Collections$UnmodifiableRandomAccessList[0])
в чем проблема ....: (