jersist
2021-09-01 09:39
采纳率: 100%
浏览 131
已结题

如何使用SpringBoot解析JSON数组


{"errcode":0,"result":[{"check_date_time":"2021-08-27 17:57:30","check_status":"Checked","check_type":"OnDuty","corp_id":"ding7c748955d913770335c2f4657eb6378f","gmt_create":"2021-08-27 17:57:31","gmt_modified":"2021-08-27 17:57:31","group_id":-1,"id":235069117132,"is_rest":"N","real_plan_time":"2021-08-27 17:57:30","user_id":"242157225634238654","work_date":"2021-08-27 00:00:00"}],"success":true,"request_id":"8kus66o51zb2"}

之前的


{"errcode":0,"result":{"approve_list":[],"attendance_result_list":[{"check_type":"OffDuty","class_id":214655132,"group_id":240975087,"location_method":"ATM","location_result":"Normal","plan_check_time":"2021-07-14 17:00:00","plan_id":217863022888,"record_id":67835293281,"source_type":"ATM","time_result":"Normal","user_address":"前台","user_check_time":"2021-07-14 17:15:35"},{"check_type":"OnDuty","class_id":214655132,"group_id":240975087,"location_method":"ATM","location_result":"Normal","plan_check_time":"2021-07-14 08:00:00","plan_id":217863022887,"record_id":67956355229,"source_type":"ATM","time_result":"Normal","user_address":"前台","user_check_time":"2021-07-14 07:58:52"}],"check_record_list":[{"record_id":67835293281,"source_type":"ATM","user_check_time":"2021-07-14 17:15:35","valid_matched":true},{"record_id":67956355229,"source_type":"ATM","user_check_time":"2021-07-14 07:58:52","valid_matched":true}],"class_setting_info":{"rest_time_vo_list":[{"rest_begin_time":14400000,"rest_end_time":18000000}]},"corpId":"ding7c748955d913770335c2f4657eb6378f","userid":"51191","work_date":"2021-07-14 09:00:00"},"success":true,"request_id":"10hbita0g2902"}

然后用了两种办法,一种因为缺少Object名导致不知道怎么单独建list,从而无法反序列化。第二种直接创建LIST导致无法正常CAST

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

4条回答 默认 最新

相关推荐 更多相似问题