내가 설정해둔 dto 의 모습이다.
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TotalDoubleList {
ToDoDoubleList Project;
ToDoDoubleList Design;
ToDoDoubleList Bom;
ToDoDoubleList Item;
ToDoDoubleList CRCO;
ToDoDoubleList Release;
ToDoDoubleList Document;
}
public TotalDoubleList readTotalTodo(){
TotalDoubleList total = new TotalDoubleList(
readProjectTodo(),
readDesignTodo(),
readBomTodo(),
readItemTodo(),
readCrCoTodo(),
readRELEASETodo(),
readDOCUMENTTodo()
);
return total;
}
"release": {
"lists": [
{
"category": "New First Release",
"toDoList": []
},
{
"category": "New CO Release",
"toDoList": []
},
{
"category": "Save as Draft",
"toDoList": []
},
{
"category": "Rejected Release",
"toDoList": []
},
{
"category": "Waiting Review",
"toDoList": []
}
]
},
"document": {
"lists": [
{
"category": "Save as Draft",
"toDoList": []
},
{
"category": "Rejected Document",
"toDoList": []
},
{
"category": "Waiting Review",
"toDoList": []
}
]
},
"design": {
"lists": [
{
"category": "Save as Draft",
"toDoList": []
},
{
"category": "New Design",
"toDoList": []
},
{
"category": "Rejected Design",
"toDoList": []
},
{
"category": "Waiting Review",
"toDoList": []
}
]
},
"project": {
"lists": [
{
"category": "Save as Draft",
"toDoList": [
{
"id": 1804,
"name": "111 project ",
"type": "양산개발",
"number": "M-2022-0808144651",
"reviseId": -1
}
]
}
]
},
"bom": {
"lists": [
{
"category": "Save as Draft",
"toDoList": []
},
{
"category": "Add New Bom",
"toDoList": []
},
{
"category": "Rejected Bom",
"toDoList": []
},
{
"category": "Waiting Review",
"toDoList": []
}
]
},
"item": {
"lists": [
{
"category": "Save as Draft",
"toDoList": []
},
{
"category": "Rejected Item",
"toDoList": []
},
{
"category": "Need Revise",
"toDoList": []
},
{
"category": "Waiting Review",
"toDoList": [
{
"id": 421,
"name": "강아지444",
"type": "프로덕트제품",
"number": "24000251",
"reviseId": -1
},
{
"id": 422,
"name": "강아지444",
"type": "프로덕트제품",
"number": "24000829",
"reviseId": -1
},
{
"id": 423,
"name": "강아지444",
"type": "프로덕트제품",
"number": "24000513",
"reviseId": -1
},
{
"id": 396,
"name": "www ",
"type": "프로덕트제품",
"number": "24000537",
"reviseId": -1
}
]
}
]
},
"crco": {
"lists": [
{
"category": "Save as Draft CR",
"toDoList": []
},
{
"category": "Save as Draft CO",
"toDoList": []
},
{
"category": "Rejected CR",
"toDoList": []
},
{
"category": "Rejected CO",
"toDoList": []
},
{
"category": "Waiting Review CR",
"toDoList": []
},
{
"category": "Waiting Review CO",
"toDoList": []
}
]
}
}
}
}
public Map<String, ToDoDoubleList> readTotalTodo(){
//TotalDoubleList total = totalMap;
Map<String, ToDoDoubleList> totalMap= new LinkedHashMap<>();
totalMap.put("Project", readProjectTodo());
totalMap.put("Design", readDesignTodo());
totalMap.put("Bom", readBomTodo());
totalMap.put("Item", readItemTodo());
totalMap.put("CR / CO", readCrCoTodo());
totalMap.put("Release", readRELEASETodo());
totalMap.put("Document", readDOCUMENTTodo());
return totalMap;
}
https://stackoverflow.com/questions/16870416/does-the-sequence-of-the-values-matter-in-a-json-object
https://codechacha.com/ko/java-hashmap-with-insertion-order/