Commit 28edd6c20ddde83de83b710996c7fb811f01df66
1 parent
bd9dfa978a
Exists in
master
and in
1 other branch
platform permission
add return pageinfo
Showing 4 changed files with 44 additions and 7 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/DepartmentsController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RolesController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/DepartmentsController.java
View file @
28edd6c
| ... | ... | @@ -4,8 +4,10 @@ |
| 4 | 4 | import com.lyms.platform.common.annotation.TokenRequired; |
| 5 | 5 | import com.lyms.platform.common.base.BaseController; |
| 6 | 6 | import com.lyms.platform.common.base.LoginContext; |
| 7 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
| 7 | 8 | import com.lyms.platform.common.enums.YnEnums; |
| 8 | 9 | import com.lyms.platform.common.utils.ResultUtils; |
| 10 | +import com.lyms.platform.operate.web.result.FrontEndResult; | |
| 9 | 11 | import com.lyms.platform.permission.model.*; |
| 10 | 12 | import com.lyms.platform.permission.service.*; |
| 11 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -185,7 +187,12 @@ |
| 185 | 187 | departments.setOrganization(organizationService.getOrganization(departments.getOrgId())); |
| 186 | 188 | } |
| 187 | 189 | |
| 188 | - ResultUtils.buildSuccessResultAndWrite(response, departmentses); | |
| 190 | + FrontEndResult frontEndResult = new FrontEndResult(); | |
| 191 | + frontEndResult.setData(departmentses); | |
| 192 | + frontEndResult.setPageInfo(departmentsQuery.getPageInfo()); | |
| 193 | + frontEndResult.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 194 | + | |
| 195 | + ResultUtils.buildSuccessResultAndWrite(response, frontEndResult); | |
| 189 | 196 | } |
| 190 | 197 | |
| 191 | 198 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
View file @
28edd6c
| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 8 | 8 | import com.lyms.platform.common.enums.YnEnums; |
| 9 | 9 | import com.lyms.platform.common.utils.ResultUtils; |
| 10 | +import com.lyms.platform.operate.web.result.FrontEndResult; | |
| 10 | 11 | import com.lyms.platform.permission.model.Organization; |
| 11 | 12 | import com.lyms.platform.permission.model.OrganizationQuery; |
| 12 | 13 | import com.lyms.platform.permission.model.Users; |
| 13 | 14 | |
| ... | ... | @@ -197,9 +198,14 @@ |
| 197 | 198 | organizationQuery.setPage(page); |
| 198 | 199 | organizationQuery.setLimit(limit); |
| 199 | 200 | organizationQuery.setKeyword(keyword); |
| 200 | - | |
| 201 | 201 | List<Organization> organizations = organizationService.queryOrganization(organizationQuery); |
| 202 | - ResultUtils.buildSuccessResultAndWrite(response, organizations); | |
| 202 | + | |
| 203 | + FrontEndResult frontEndResult = new FrontEndResult(); | |
| 204 | + frontEndResult.setData(organizations); | |
| 205 | + frontEndResult.setPageInfo(organizationQuery.getPageInfo()); | |
| 206 | + frontEndResult.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 207 | + | |
| 208 | + ResultUtils.buildSuccessResultAndWrite(response, frontEndResult); | |
| 203 | 209 | } |
| 204 | 210 | |
| 205 | 211 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RolesController.java
View file @
28edd6c
| ... | ... | @@ -4,10 +4,12 @@ |
| 4 | 4 | import com.lyms.platform.common.annotation.TokenRequired; |
| 5 | 5 | import com.lyms.platform.common.base.BaseController; |
| 6 | 6 | import com.lyms.platform.common.base.LoginContext; |
| 7 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
| 7 | 8 | import com.lyms.platform.common.enums.YnEnums; |
| 8 | 9 | import com.lyms.platform.common.exception.BusinessException; |
| 9 | 10 | import com.lyms.platform.common.utils.Assert; |
| 10 | 11 | import com.lyms.platform.common.utils.ResultUtils; |
| 12 | +import com.lyms.platform.operate.web.result.FrontEndResult; | |
| 11 | 13 | import com.lyms.platform.permission.model.*; |
| 12 | 14 | import com.lyms.platform.permission.service.*; |
| 13 | 15 | import org.apache.commons.lang.StringUtils; |
| ... | ... | @@ -314,7 +316,13 @@ |
| 314 | 316 | rolesQuery.setLimit(limit); |
| 315 | 317 | |
| 316 | 318 | List<Roles> roles = rolesService.queryRoles(rolesQuery); |
| 317 | - ResultUtils.buildSuccessResultAndWrite(response, roles); | |
| 319 | + | |
| 320 | + FrontEndResult frontEndResult = new FrontEndResult(); | |
| 321 | + frontEndResult.setPageInfo(rolesQuery.getPageInfo()); | |
| 322 | + frontEndResult.setData(roles); | |
| 323 | + frontEndResult.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 324 | + | |
| 325 | + ResultUtils.buildSuccessResultAndWrite(response, frontEndResult); | |
| 318 | 326 | } |
| 319 | 327 | |
| 320 | 328 | |
| ... | ... | @@ -342,7 +350,14 @@ |
| 342 | 350 | rolesQuery.setLimit(limit); |
| 343 | 351 | |
| 344 | 352 | List<Roles> roles = rolesService.queryRoles(rolesQuery); |
| 345 | - ResultUtils.buildSuccessResultAndWrite(response, roles); | |
| 353 | + | |
| 354 | + | |
| 355 | + FrontEndResult frontEndResult = new FrontEndResult(); | |
| 356 | + frontEndResult.setPageInfo(rolesQuery.getPageInfo()); | |
| 357 | + frontEndResult.setData(roles); | |
| 358 | + frontEndResult.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 359 | + | |
| 360 | + ResultUtils.buildSuccessResultAndWrite(response, frontEndResult); | |
| 346 | 361 | } |
| 347 | 362 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java
View file @
28edd6c
| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 9 | 9 | import com.lyms.platform.common.enums.YnEnums; |
| 10 | 10 | import com.lyms.platform.common.utils.*; |
| 11 | +import com.lyms.platform.operate.web.result.FrontEndResult; | |
| 11 | 12 | import com.lyms.platform.permission.model.*; |
| 12 | 13 | import com.lyms.platform.permission.service.*; |
| 13 | 14 | import org.apache.commons.lang.StringUtils; |
| 14 | 15 | |
| ... | ... | @@ -88,8 +89,12 @@ |
| 88 | 89 | user.setDepartmentses(departmentsService.getDepartments(user.getDeptId())); |
| 89 | 90 | } |
| 90 | 91 | |
| 92 | + FrontEndResult frontEndResult = new FrontEndResult(); | |
| 93 | + frontEndResult.setPageInfo(usersQuery.getPageInfo()); | |
| 94 | + frontEndResult.setData(users); | |
| 95 | + frontEndResult.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 91 | 96 | |
| 92 | - ResultUtils.buildSuccessResultAndWrite(response, users); | |
| 97 | + ResultUtils.buildSuccessResultAndWrite(response, frontEndResult); | |
| 93 | 98 | } |
| 94 | 99 | |
| 95 | 100 | |
| 96 | 101 | |
| ... | ... | @@ -133,8 +138,12 @@ |
| 133 | 138 | user.setDepartmentses(departmentsService.getDepartments(user.getDeptId())); |
| 134 | 139 | } |
| 135 | 140 | |
| 141 | + FrontEndResult frontEndResult = new FrontEndResult(); | |
| 142 | + frontEndResult.setPageInfo(usersQuery.getPageInfo()); | |
| 143 | + frontEndResult.setData(users); | |
| 144 | + frontEndResult.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 136 | 145 | |
| 137 | - ResultUtils.buildSuccessResultAndWrite(response, users); | |
| 146 | + ResultUtils.buildSuccessResultAndWrite(response, frontEndResult); | |
| 138 | 147 | } |
| 139 | 148 | |
| 140 | 149 | //获取用户角色信息 |