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
2d79930c
Commit
2d79930c
authored
Apr 01, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志查询接口权限控制
parent
2ebc73cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
5 deletions
+30
-5
MenuController.java
...main/java/com/gic/auth/web/controller/MenuController.java
+30
-5
No files found.
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/MenuController.java
View file @
2d79930c
...
...
@@ -2,10 +2,8 @@ package com.gic.auth.web.controller;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.gic.auth.constant.MenuProjectConstants
;
import
com.gic.log.api.dto.LogSearchDTO
;
...
...
@@ -194,7 +192,8 @@ public class MenuController {
result
=
menuApiService
.
listAppPageOfHasBuy
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
}
else
{
//权限控制
result
=
menuApiService
.
getUserMenuOfAppNotTree
(
userDetail
.
getEnterpriseId
(),
userDetail
.
getUserId
(),
null
,
null
);
result
=
menuApiService
.
getUserMenuOfAppNotTree
(
userDetail
.
getEnterpriseId
(),
userDetail
.
getUserId
(),
null
,
null
);
}
if
(
result
.
isSuccess
())
{
return
RestResponse
...
...
@@ -227,6 +226,32 @@ public class MenuController {
searchParam
.
setRelationId
(
Long
.
valueOf
(
menuId
));
}
else
{
//权限控制
List
<
Long
>
relationIdList
=
new
ArrayList
<>();
UserDetail
userDetail
=
UserDetailUtils
.
getUserDetail
();
//权限控制
ServiceResponse
<
List
<
MenuDTO
>>
gicResult
=
menuApiService
.
getUserMenuOfGicNotTree
(
userDetail
.
getEnterpriseId
(),
userDetail
.
getUserId
(),
null
,
userDetail
.
getEnterpriseInfo
().
getVersionCode
());
if
(
gicResult
.
isSuccess
())
{
List
<
MenuDTO
>
gicMenuList
=
gicResult
.
getResult
();
relationIdList
.
addAll
(
Optional
.
ofNullable
(
gicMenuList
).
orElse
(
new
ArrayList
<>()).
stream
()
.
mapToLong
(
e
->
e
.
getMenuId
()).
boxed
().
collect
(
Collectors
.
toList
()));
}
boolean
isSuperAdmin
=
userDetail
.
getUserInfo
().
getSuperAdmin
().
intValue
()
==
1
;
ServiceResponse
<
List
<
MenuDTO
>>
appResult
;
if
(
isSuperAdmin
)
{
appResult
=
menuApiService
.
listAppPageOfHasBuy
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
}
else
{
//权限控制
appResult
=
menuApiService
.
getUserMenuOfAppNotTree
(
userDetail
.
getEnterpriseId
(),
userDetail
.
getUserId
(),
null
,
null
);
}
if
(
appResult
.
isSuccess
())
{
List
<
MenuDTO
>
appMenuList
=
appResult
.
getResult
();
relationIdList
.
addAll
(
Optional
.
ofNullable
(
appMenuList
).
orElse
(
new
ArrayList
<>()).
stream
()
.
mapToLong
(
e
->
e
.
getMenuId
()).
boxed
().
collect
(
Collectors
.
toList
()));
}
searchParam
.
setRelationIdList
(
relationIdList
);
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"YYYY-MM-dd HH:mm:ss"
);
if
(
StringUtils
.
isNotBlank
(
startTime
))
{
...
...
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