String字符串转对象
1.使用JSON格式校验器提取为java实体类
2.使用ObjectMapper直接将String串转成对像
ObjectMapper objectMapper = new ObjectMapper();
BaiduChatModel chatModel = objectMapper.readValue(answer,BaiduChatModel.class);
String字符串转对象
1.使用JSON格式校验器提取为java实体类
2.使用ObjectMapper直接将String串转成对像
ObjectMapper objectMapper = new ObjectMapper();
BaiduChatModel chatModel = objectMapper.readValue(answer,BaiduChatModel.class);