你想返回结构是怎么样就怎么样
@Component
@RestController
@RequestMapping(value = "/")
public class TestController {
private Logger log = LogManager.getLogger("mylog");
@RequestMapping(value="/",method= RequestMethod.GET)
public JSONObject getSchedule(HttpSession session)
{
JSONObject jsonObj = new JSONObject();
jsonObj.put("message", "hello world81");
jsonObj.put("flag", "810");
log.info(jsonObj.toString());
//jsonObj.put("testUrl", testUrl);
return jsonObj;
}
}
【 在 iStudy 的大作中提到: 】
: 我希望返回的responsebody是json,格式是我自己定义的,怎么做?
: 要用哪些类?有参考文章吗,谢谢
--
FROM 60.176.50.*