请原谅我使用错误的条款,但我对这种技术完全陌生。关于我的问题: 我有一个返回
的webapp {
"amount": "1",
"unit": "59edd0b2b714531cac8afced",
"part": "59ede77d52023619d45e949a",
"comment": "comment 1"
}
或
{
"amount":["12","24"],
"unit":["59edd0b2b714531cac8afced","59edd0b7b714531cac8afcee"],
"part":["59ede77d52023619d45e949a","59fe50ca25811e25cc38446d"],
"comment":["comment xyz","comment whatever"]
}
在这两种情况下,我都想拥有一系列对象,如下所示:
[
{
"amount": "12",
"unit": "59edd0b2b714531cac8afced",
"part": "59ede77d52023619d45e949a",
"comment": "comment xyz"
},
{
"amount": "24",
"unit": "59edd0b7b714531cac8afcee",
"part": "59fe50ca25811e25cc38446d",
"comment": "comment whatever""
}
]
最简单的方法是什么? 谢谢你的帮助。
答案 0 :(得分:1)
我可能只是构建一个将其转换为您想要的格式的函数,如下所示:
@EnableTransactionManagement

这假设如果它采用数组格式,每个键将包含一个相同长度的数组。