Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- onTouch
- 동적계획법
- boj_15684
- django
- BOJ
- boj15998
- DP
- boj7579
- boj15683
- backtracking
- boj2239
- TDD
- bruteforce
- boj15654
- boj2252
- boj_15685
- boj10775
- mysql
- nestedjson
- DynamicProgramming
- boj15954
- euclideanalgorithm
- onTouchListner
- testdb
- boj10942
- Spring
- springboot
- DFS
- BFS
- react
Archives
- Today
- Total
목록DTO (1)
이마닷의 블로그

결론은 dto. dto 안에 또다른 dto를 넣어주면 된다. 또 별다른 방법이 있는지는 모르겠지만, 만들어 놓은 entity를 바탕으로 json 안에 쓰고 싶은 dto를 새로 만들어서 스키마에 맞게 써넣으면 된다. Django에서 nested serializer를 쓰던 것과 상당히 비슷하다. 즉, { name: "test", age: 23, nested: [ { id: 1, content: "nestedTest" }, ... , { ... } ] } 이런 스키마를 갖는 json을 날리고 싶다면, class MainDto { String name; Integer age; NestedDto nested; } class NestedDto { Long id; String content; } 이런 식의 dto를 ..
java + kotlin
2020. 12. 25. 00:20