@Controller
@RequestMapping("/superadmin")
public class AreaController {
@Autowired
private AreaService areaService;
@RequestMapping(value="/listarea",method=RequestMethod.GET)
@ResponseBody
private Map<String,Object> listArea(){
Map<String,Object> modelMap = new HashMap<String,Object>();
List<Area>list = new ArrayList<Area>();
try {
list = areaService.getAreaList();
modelMap.put("rows", list);
modelMap.put("total", list.size());
}catch(Exception e) {
e.printStackTrace();
modelMap.put("success", false);
modelMap.put("errMsg", e.toString());
}
return modelMap;
}
}
SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需
了解课程