1 回答
TA贡献1772条经验 获得超8个赞
rootNode 有节点“API”。currentNode:
{
"results":543,
"fixtures":[
{
"fixture_id":95095,
"venue":"Estádio Rei Pelé",
"goalsHomeTeam":1,
"goalsAwayTeam":1,
"awayTeam":{
"logo":"https://media.api-football.com/teams/156.png",
"team_id":156,
"team_name":"Sao Bento"
},
"event_timestamp":1569715200,
"referee":null,
"elapsed":90,
"score":{
"halftime":"0-0",
"penalty":null,
"fulltime":"1-1",
"extratime":null
},
"round":"Regular Season - 25",
"event_date":"2019-09-29T00:00:00+00:00",
"statusShort":"FT",
"homeTeam":{
"logo":"https://media.api-football.com/teams/146.png",
"team_id":146,
"team_name":"CRB"
}
}
]
}
正确的代码:
int fixture_id = currentNode.path("fixtures").findValue("fixture_id").asInt();
添加回答
举报