我有一个主列表,它们有两个字段,分别是名称和评级,在序列化到数组节点之后,我需要为每个对象再添加一个字段,例如我有 json
[{"masterName":"Bruce","rating":30},{"masterName":"Tom","rating":25}]
我有 json 格式的 servisec 列表,看起来像这样
[{"masterName":"Bruce","services":["hair coloring","massage"]},{"masterName":"Tom","services":["hair coloring","haircut"]}]
我需要它看起来像那样
[{"masterName":"Bruce","rating":30,"services":"hair coloring,massage"},{"masterName":"Tom","rating":25,"services":"hair coloring, haircut"}]
使用杰克逊如何做到这一点?