Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-auth
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-platform-auth
Commits
7b052407
Commit
7b052407
authored
Sep 04, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增商户所有菜单接口
parent
c8540aa4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
RoleController.java
...main/java/com/gic/auth/web/controller/RoleController.java
+28
-0
No files found.
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/RoleController.java
View file @
7b052407
package
com
.
gic
.
auth
.
web
.
controller
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.MenuDTO
;
import
com.gic.auth.dto.UserDTO
;
import
com.gic.auth.service.MenuApiService
;
import
com.gic.auth.service.UserApiService
;
import
com.gic.enterprise.response.EnterpriseRestResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -14,6 +19,9 @@ import com.gic.commons.webapi.reponse.RestResponse;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
javax.xml.ws.Service
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/role"
)
public
class
RoleController
{
...
...
@@ -22,6 +30,8 @@ public class RoleController {
private
RoleApiService
roleApiService
;
@Autowired
private
MenuApiService
menuApiService
;
@Autowired
private
UserApiService
userApiService
;
@RequestMapping
(
"/get-detail"
)
public
RestResponse
getDetail
(
Integer
id
)
{
...
...
@@ -56,4 +66,22 @@ public class RoleController {
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
return
ResultControllerUtils
.
commonResult
(
roleApiService
.
listRole
(
enterpriseId
),
RoleSelectVO
.
class
);
}
@RequestMapping
(
"/list-menu"
)
public
RestResponse
listMenu
()
{
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
<
UserDTO
>
userResponse
=
userApiService
.
getUserByEnterpriseId
(
enterpriseId
);
if
(
userResponse
.
isSuccess
())
{
UserDTO
admin
=
userResponse
.
getResult
();
Integer
userId
=
admin
.
getUserId
();
ServiceResponse
<
List
<
MenuDTO
>>
menuResponse
=
menuApiService
.
getSuperAdminMenu
(
userId
,
enterpriseId
);
if
(
menuResponse
.
isSuccess
())
{
return
RestResponse
.
success
(
menuResponse
.
getResult
());
}
else
{
return
EnterpriseRestResponse
.
failure
(
menuResponse
);
}
}
else
{
return
EnterpriseRestResponse
.
failure
(
userResponse
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment