📜  如何在 api spring boot 中返回自定义值 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:59.335000             🧑  作者: Mango

代码示例1
String s = "{\"success\": true, ";
ObjectMapper om = new ObjectMapper();
s += "\"friends\": " + om.writeValueAsString(myList).replace('"', '\'') + ", ";
s += "\"count\": " + myList.size();
s += "}";
return s;