@RequestMapping public ModelAndView findAllAreas(String cityId) { ModelAndView mv = new ModelAndView("area/area_list"); City city = areaService.findCity(new ObjectId(cityId)); mv.addObject("areaList", city.getAreas()); mv.addObject("city", city); return mv; }
@RequestMapping public ModelAndView create_start_area(String cityId) { ModelAndView mv = new ModelAndView("area/create_area"); if (StringUtil.isEmpty(cityId)) { return mv; } City city = areaService.findCity(new ObjectId(cityId)); mv.addObject("city", city); return mv; }
@ResponseBody @RequestMapping public List<Area> findAreas(String cityId) { City city = areaService.findCity(new ObjectId(cityId)); List<Area> areaList = new ArrayList<Area>(); for (Area area : city.getAreas()) { area.setCity(null); areaList.add(area); } return areaList; }