示例#1
0
 @RequestMapping(value = "/district", method = RequestMethod.GET)
 public HttpEntity<String> getdistrict(RegionSearcher searcher, Model model) {
   GrantResult grantResult = new GrantResult(SUCCESS, "查询成功");
   grantResult.setResult(regionService.findRegionList((RegionExample) searcher.getExample()));
   JSONResponse jsonResponse = new JSONResponse(grantResult);
   return new ResponseEntity<String>(jsonResponse.getBody(), jsonResponse.getHttpStatus());
 }
示例#2
0
 @RequestMapping(value = "/add/landmark", method = RequestMethod.POST)
 public HttpEntity<String> addLandmark(@RequestBody Landmark landmark, Model model) {
   Long id = landmarkService.saveLandmark(landmark);
   JSONResponse jsonResponse =
       new JSONResponse(
           id > 0 ? new GrantResult(SUCCESS, "地标创建成功") : new GrantResult(FAILD, "地标创建失败"));
   return new ResponseEntity<String>(jsonResponse.getBody(), jsonResponse.getHttpStatus());
 }
示例#3
0
 @RequestMapping(value = "/edit/landmark", method = RequestMethod.POST)
 public HttpEntity<String> editLandmark(@RequestBody Landmark landmark, Model model) {
   JSONResponse jsonResponse =
       new JSONResponse(
           landmarkService.modifyLandmark(landmark)
               ? new GrantResult(SUCCESS, "编辑地标成功")
               : new GrantResult(FAILD, "编辑地标失败"));
   return new ResponseEntity<String>(jsonResponse.getBody(), jsonResponse.getHttpStatus());
 }