| | |
| | | package com.stylefeng.guns.modular.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.modular.system.model.Region; |
| | | import com.stylefeng.guns.modular.system.service.IRegionService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | public class SysRegionController { |
| | | @Autowired |
| | | private IRegionService regionService; |
| | | /** |
| | | * 获取市级数据列表 |
| | | */ |
| | | @RequestMapping(value = "/cityList") |
| | | @ResponseBody |
| | | public Object cityList(Integer parentId) { |
| | | if(parentId==null){ |
| | | parentId=0; |
| | | } |
| | | List<Region> cities=regionService.selectList(new EntityWrapper<Region>().eq("parentId",parentId)); |
| | | return cities; |
| | | } |
| | | // /** |
| | | // * 获取市级数据列表 |
| | | // */ |
| | | // @RequestMapping(value = "/cityList") |
| | | // @ResponseBody |
| | | // public Object cityList(Integer parentId) { |
| | | // if(parentId==null){ |
| | | // parentId=0; |
| | | // } |
| | | // List<Region> cities=regionService.selectList(new EntityWrapper<Region>().eq("parentId",parentId)); |
| | | // return cities; |
| | | // } |
| | | } |