fastjson 多层嵌套问题依然存在

yhuiod9q  于 2021-11-27  发布在  Java
关注(0)|答案(0)|浏览(264)
val str = """{"data":{"count":4,"disabled":false,"enalbed":true,"first":1,"hasNext":true,"last":1,"lastPage":true,"limit":2147483647,"list":[{"costFamily":600.0,"costOwner":525.0,"endDate":"2018-02-01","id":"2dbcf555f924446b8985fcb5eede95e4","planNo":50,"startDate":"2018-01-01","title":"*标题"},{"costFamily":52.0,"costOwner":585.0,"endDate":"2018-01-25","id":"3683a598d935450ab73bd3559c9b9a30","planNo":52,"startDate":"2018-01-01","title":"555"},{"endDate":"2018-01-24","id":"3b03b4540fc44ff0ad7e0d85e4b7f404","startDate":"2018-01-09","title":"*标题*标题"},{"endDate":"2018-01-26","id":"71853ddfec0c45f09fa936a1055f3597","startDate":"2018-01-01","title":"标题:标题:标题:"}],"offset":0,"orderBy":"","pageNo":1,"pageSize":10,"selectCount":false,"totalPage":1},"status":200,"success":true,"timestamp":1515478954209}
"""
    println(JSON.parseObject(str, object : TypeReference<HdasResponse<Page<TourProjectModel>>>() {

    }))

这时page里的List的范型为jsonobject 并不能解析成TourProjectModel

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题