1. 程式人生 > >Spring Boot04 之 使用別的json解析

Spring Boot04 之 使用別的json解析

個人習慣於使用fastJson來解析 <!-- 使用其它json轉換 --> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> </dependency> @RestController @RequestMapping("/demo") public class DemoController { @RequestMapping("/getFastJson") public String getFastJson(){ Demo demo=new Demo(); demo.setId(3); demo.setName("李四"); return JSONObject.toJSONString(demo); } }