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
de9f19d5
Commit
de9f19d5
authored
May 07, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
3476e935
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
ResourceApiService.java
...rc/main/java/com/gic/auth/service/ResourceApiService.java
+10
-0
ResourceApiServiceImpl.java
...m/gic/auth/service/outer/impl/ResourceApiServiceImpl.java
+16
-0
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/service/ResourceApiService.java
View file @
de9f19d5
...
...
@@ -101,4 +101,14 @@ public interface ResourceApiService {
* @throws
*/
ServiceResponse
<
OrderResourceDTO
>
getOrderResourceByUserId
(
Integer
userId
);
/**
* @Title: getUserResourceByUserId
* @Description:
* @author zhiwj
* @param userId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.auth.dto.OrderResourceDTO> 返回null表示没有授权 返回 -1 表示全部
* @throws
*/
ServiceResponse
<
Long
>
getUserResourceByUserId
(
Integer
userId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/ResourceApiServiceImpl.java
View file @
de9f19d5
...
...
@@ -342,4 +342,20 @@ public class ResourceApiServiceImpl implements ResourceApiService {
return
EnterpriseServiceResponse
.
success
(
defaultResource
);
}
@Override
public
ServiceResponse
<
Long
>
getUserResourceByUserId
(
Integer
userId
)
{
TabSysUser
user
=
userService
.
getUserById
(
userId
);
if
(
user
.
getSuperAdmin
()
==
1
)
{
// 是超管就返回所有
return
EnterpriseServiceResponse
.
success
(-
1L
);
}
List
<
UserResourceDTO
>
resourceDTOList
=
this
.
userResourceService
.
listUserResourceByUserId
(
userId
);
if
(
CollectionUtils
.
isEmpty
(
resourceDTOList
))
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
UserResourceDTO
userResourceDTO
=
resourceDTOList
.
get
(
0
);
TabSysResource
resource
=
this
.
resourceService
.
getResource
(
userResourceDTO
.
getResourceId
());
return
EnterpriseServiceResponse
.
success
(
resource
.
getUserResource
());
}
}
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