如何将页面对象转换为DTO?

时间:2019-10-21 06:18:07

标签: java spring-boot

我有一个类似于以下的页面对象,如何将其转换为DTO?

TestData::select('id')->WhereJsonContains('test_data->test_info->type', ["text"]);

1 个答案:

答案 0 :(得分:0)

我相信以下代码可以解决问题:

返回LatestPosts.stream()。map(post-> postMapper.postToPostDto(post))。collect(Collectors.toList());