@RequestMapping public ModelAndView findAllCities(String proId) { ModelAndView mv = new ModelAndView("area/city_list"); Province province = areaService.findProvince(new ObjectId(proId)); mv.addObject("province", province); mv.addObject("cityList", province.getCities()); return mv; }
@RequestMapping public ModelAndView create_start_city(String proId) { ModelAndView mv = new ModelAndView("area/create_city"); if (StringUtil.isEmpty(proId)) { return mv; } Province province = areaService.findProvince(new ObjectId(proId)); mv.addObject("province", province); return mv; }
@ResponseBody @RequestMapping public List<City> findCities(String proId) { Province province = areaService.findProvince(new ObjectId(proId)); List<City> cities = new ArrayList<City>(); for (City city : province.getCities()) { city.setProvince(null); city.setAreas(null); cities.add(city); } return cities; }