У меня есть два похожих объекта JSON, и их единственное отличие - joined_user
.Во втором joined_user
это []
.Я хотел бы декодировать их, используя одну структуру, как я могу это сделать?
Это мой первый объект JSON
{
"joined_user":[
{
"_id":"5c72c03cd1c32313908845d8"
},
{
"_id":"5c72c14ad1c32313908845db"
}
],
"allRooms":[
{
"Capacity":{
"Free":10,
"Total":10
},
"Finished":false,
"Pic":"http://192.168.1.101:2525/icon.png",
"_id":"5c72bf3fd1c32313908845d6",
"Coin_input":10,
"Award_money":100000,
"Award_coin":100,
"Match_time":"1551551483",
"Winner_number":1
},
{
"Capacity":{
"Free":20,
"Total":20
},
"Finished":false,
"Pic":"http://192.168.1.101:2525/icon.png",
"_id":"5c72bf58d1c32313908845d7",
"Coin_input":20,
"Award_money":200000,
"Award_coin":200,
"Match_time":"1551551483",
"Winner_number":1
},
{
"Capacity":{
"Free":9,
"Total":10
},
"Finished":false,
"Pic":"http://192.168.1.101:2525/icon.png",
"_id":"5c72c03cd1c32313908845d8",
"Coin_input":100,
"Award_money":100000,
"Award_coin":1000,
"Match_time":"1551551483",
"Winner_number":1
},
{
"Capacity":{
"Free":20,
"Total":20
},
"Finished":false,
"Pic":"http://192.168.1.101:2525/icon.png",
"_id":"5c72c066d1c32313908845d9",
"Coin_input":101,
"Award_money":200000,
"Award_coin":2000,
"Match_time":"1551551483",
"Winner_number":1
},
{
"Capacity":{
"Free":9209269,
"Total":10000000
},
"Finished":true,
"Pic":"http://192.168.1.101:2525/icon.png",
"_id":"5c72c14ad1c32313908845db",
"Coin_input":12,
"Award_money":50000,
"Award_coin":500,
"Match_time":"1551540600",
"Winner_number":1
}
]
}
, а это мой второй объект JSON
{
"joined_user":"[]",
"allRooms":[
{
"Capacity":{
"Free":44,
"Total":100
},
"Finished":false,
"Pic":"www",
"_id":"5c73c1666f39db1de8977fd9",
"Coin_input":10,
"Award_money":10000,
"Award_coin":1000,
"Match_time":"9",
"Winner_number":2
},
{
"Capacity":{
"Free":9999,
"Total":9999
},
"Finished":false,
"Pic":"129",
"_id":"5c7535a56f39db1de897802d",
"Coin_input":9,
"Award_money":99999,
"Award_coin":999,
"Match_time":"9",
"Winner_number":9
},
{
"Capacity":{
"Free":9999,
"Total":9999
},
"Finished":false,
"Pic":"129",
"_id":"5c7535a66f39db1de897802e",
"Coin_input":9,
"Award_money":99999,
"Award_coin":999,
"Match_time":"9",
"Winner_number":9
},
{
"Capacity":{
"Free":9999,
"Total":9999
},
"Finished":false,
"Pic":"129",
"_id":"5c7535a86f39db1de897802f",
"Coin_input":9,
"Award_money":99999,
"Award_coin":999,
"Match_time":"9",
"Winner_number":9
}
]
}