json添加转义符,ObjectMapper 是jackson对象
@Test
void a3() throws Exception {
Item item = new Item("1", "2", "3");
ObjectMapper objectMapper = new ObjectMapper();
String s = objectMapper.writeValueAsString(JSON.toJSONString(item));
System.out.println();
}
效果