Commit 008fcc1025c4f3a92299e5a7ac898ef044036777
1 parent
072032a61e
Exists in
master
and in
1 other branch
platform permission
add return pageinfo
Showing 1 changed file with 11 additions and 14 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PermissionsController.java
View file @
008fcc1
... | ... | @@ -186,25 +186,22 @@ |
186 | 186 | /** |
187 | 187 | * 删除权限 |
188 | 188 | */ |
189 | - @RequestMapping(value = "/permissions", method = RequestMethod.DELETE) | |
189 | + @RequestMapping(value = "/permissions/{id}", method = RequestMethod.DELETE) | |
190 | 190 | @TokenRequired |
191 | - public void deletePermissions(HttpServletResponse response, @RequestParam(value = "ids") String ids) { | |
192 | - if (StringUtils.isEmpty(ids)) { | |
191 | + public void deletePermissions(HttpServletResponse response, @PathVariable(value = "id") String id) { | |
192 | + if (StringUtils.isEmpty(id)) { | |
193 | 193 | ResultUtils.buildIdIsNull(response); |
194 | 194 | return; |
195 | 195 | } |
196 | - String[] idArray = ids.split(","); | |
197 | - for (String id : idArray) { | |
198 | - Permissions permissions = permissionsService.getPermissions(Integer.valueOf(id)); | |
199 | - if (permissions == null) { | |
200 | - ResultUtils.buildIdResultData(response); | |
201 | - return; | |
202 | - } | |
203 | - permissions.setYn(YnEnums.NO.getId()); | |
204 | - permissions.setModified(new Date()); | |
205 | - permissionsService.updatePermissions(permissions); | |
206 | - | |
196 | + Permissions permissions = permissionsService.getPermissions(Integer.valueOf(id)); | |
197 | + if (permissions == null) { | |
198 | + ResultUtils.buildIdResultData(response); | |
199 | + return; | |
207 | 200 | } |
201 | + permissions.setYn(YnEnums.NO.getId()); | |
202 | + permissions.setModified(new Date()); | |
203 | + permissionsService.updatePermissions(permissions); | |
204 | + | |
208 | 205 | ResultUtils.buildSuccessResultAndWrite(response); |
209 | 206 | } |
210 | 207 |