Commit 0965c94c98b2de0f75b251c33d06ce64f48e69ec
1 parent
b4fe6958d6
Exists in
master
and in
1 other branch
bug fix
暴露区域地址请求
Showing 1 changed file with 25 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RegionController.java
View file @
0965c94
... | ... | @@ -108,5 +108,30 @@ |
108 | 108 | } |
109 | 109 | ResultUtils.buildSuccessResultAndWrite(httpServletResponse, list); |
110 | 110 | } |
111 | + | |
112 | + | |
113 | + @RequestMapping(value = "/queryRegions",method = RequestMethod.GET) | |
114 | + public void queryRegions(@RequestParam(value = "parentId", required = false) String parentId, | |
115 | + HttpServletResponse httpServletResponse, HttpServletRequest request ){ | |
116 | + BasicConfigQuery query = new BasicConfigQuery(); | |
117 | + if(StringUtils.isBlank(parentId)) { | |
118 | + query.setParentId(SystemConfig.CHINA_BASIC_ID); | |
119 | + } else { | |
120 | + query.setParentId(parentId); | |
121 | + } | |
122 | + query.setYn(YnEnums.YES.getId()); | |
123 | + | |
124 | + List<BasicConfig> configList = basicConfigService.queryBasicConfig(query); | |
125 | + List<Map<String,Object>> list =new ArrayList<Map<String, Object>>(); | |
126 | + if (CollectionUtils.isNotEmpty(configList)){ | |
127 | + for (BasicConfig config :configList){ | |
128 | + Map<String,Object> region=new HashMap<String, Object>(); | |
129 | + region.put("id",config.getId()); | |
130 | + region.put("name",config.getName()); | |
131 | + list.add(region); | |
132 | + } | |
133 | + } | |
134 | + ResultUtils.buildSuccessResultAndWrite(httpServletResponse, list); | |
135 | + } | |
111 | 136 | } |