@GetMapping("/test")
public void test(HttpServletResponse response) throws IOException {
JSONObject jsonObject =new JSONObject();
jsonObject.put("code","400");
jsonObject.put("msg","你没有相关权限!");
response.setStatus(500);
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Type","application/json;charset=utf-8");
response.setContentType("application/json;charset=utf-8");
new ObjectMapper().writeValue(response.getWriter(),jsonObject);
}