我想遍历 JsonNode 对象的所有节点,并希望从 JsonNode 对象下方获取价格详细信息,有人可以帮助我如何获取低于价格的详细信息
回复
{
"content": {
"cart": {
"logs": {
"logs_cart_100": {
"method": "over",
"items": {
"111": {
"firstName": "Ram",
"lastName": "K",
"price": {
"amount": 100.0,
"baseAmount": 100.0,
}
},
"222": {
"firstName": "Velvan",
"lastName": "S",
"price": {
"amount": 200.0,
"baseAmount": 200.0,
}
},
"333": {
"firstName": "Dinesh",
"lastName": "M",
"price": {
"amount": 300.0,
"baseAmount": 300.0,
}
}
}
}
},
"promotions": [
{
"promotionName": "Dummy-1"
},
{
"promotionName": "Dummy-2"
},
{
"promotionName": "Dummy-3"
}
]
}
}
}
ObjectMapper mapper = new ObjectMapper();
JsonNode actualObj = mapper.readValue(response, JsonNode.class);