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
14a23f89
Commit
14a23f89
authored
Feb 13, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加渠道资源对管理员的判断
parent
d4317004
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-0
pom.xml
gic-platform-auth-service/pom.xml
+5
-0
ResourceApiServiceImpl.java
...m/gic/auth/service/outer/impl/ResourceApiServiceImpl.java
+33
-0
dubbo-gic-platform-auth-service.xml
...ce/src/main/resources/dubbo-gic-platform-auth-service.xml
+6
-0
No files found.
gic-platform-auth-service/pom.xml
View file @
14a23f89
...
...
@@ -142,6 +142,11 @@
<artifactId>
application-center-api
</artifactId>
<version>
${application-center-api}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-member-config-api
</artifactId>
<version>
${gic-member-config-api}
</version>
</dependency>
</dependencies>
<build>
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/ResourceApiServiceImpl.java
View file @
14a23f89
...
...
@@ -15,6 +15,12 @@ import com.gic.commons.util.EntityUtil;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.response.EnterpriseServiceResponse
;
import
com.gic.member.config.api.dto.AppletsConfigSimpleOutputDTO
;
import
com.gic.member.config.api.dto.OwnerMemberCardDTO
;
import
com.gic.member.config.api.dto.ServiceConfigSimpleOutputDTO
;
import
com.gic.member.config.api.service.AppletsConfigApiService
;
import
com.gic.member.config.api.service.MemberCardApiService
;
import
com.gic.member.config.api.service.ServiceConfigApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -48,6 +54,12 @@ public class ResourceApiServiceImpl implements ResourceApiService {
private
UserService
userService
;
@Autowired
private
AuthorizeService
authorizeService
;
@Autowired
private
MemberCardApiService
memberCardApiService
;
@Autowired
private
AppletsConfigApiService
appletsConfigApiService
;
@Autowired
private
ServiceConfigApiService
serviceConfigApiService
;
@Override
...
...
@@ -210,6 +222,27 @@ public class ResourceApiServiceImpl implements ResourceApiService {
@Override
public
ServiceResponse
<
ChannelResourceDTO
>
getChannelResourceByUserId
(
Integer
userId
)
{
TabSysUser
user
=
this
.
userService
.
getUserById
(
userId
);
if
(
user
==
null
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
if
(
user
.
getSuperAdmin
()
==
1
)
{
List
<
OwnerMemberCardDTO
>
memberCardList
=
memberCardApiService
.
getAll
(
user
.
getEnterpriseId
()).
getResult
();
List
<
AppletsConfigSimpleOutputDTO
>
appletList
=
appletsConfigApiService
.
listValidAppletConfigAppId
(
user
.
getEnterpriseId
()).
getResult
();
List
<
ServiceConfigSimpleOutputDTO
>
serviceList
=
serviceConfigApiService
.
listValidServiceConfigAppId
(
user
.
getEnterpriseId
()).
getResult
();
ChannelResourceDTO
channelResourceDTO
=
new
ChannelResourceDTO
();
channelResourceDTO
.
setAppletConfigIdList
(
Optional
.
ofNullable
(
appletList
).
orElse
(
Collections
.
emptyList
()).
stream
().
map
(
AppletsConfigSimpleOutputDTO:
:
getAppletConfigId
).
collect
(
Collectors
.
toList
()));
channelResourceDTO
.
setServiceConfigIdList
(
Optional
.
ofNullable
(
serviceList
).
orElse
(
Collections
.
emptyList
()).
stream
().
map
(
ServiceConfigSimpleOutputDTO:
:
getServiceConfigId
).
collect
(
Collectors
.
toList
()));
channelResourceDTO
.
setCardConfigIdList
(
Optional
.
ofNullable
(
memberCardList
).
orElse
(
Collections
.
emptyList
()).
stream
().
map
(
OwnerMemberCardDTO:
:
getCardConfigId
).
collect
(
Collectors
.
toList
()));
return
EnterpriseServiceResponse
.
success
(
channelResourceDTO
);
}
List
<
UserResourceDTO
>
resourceDTOList
=
this
.
userResourceService
.
listUserResourceByUserId
(
userId
);
if
(
CollectionUtils
.
isEmpty
(
resourceDTOList
))
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
...
...
gic-platform-auth-service/src/main/resources/dubbo-gic-platform-auth-service.xml
View file @
14a23f89
...
...
@@ -56,4 +56,10 @@
<dubbo:service
interface=
"com.gic.auth.service.UserResourceApiService"
ref=
"userResourceApiService"
timeout=
"6000"
/>
<dubbo:service
interface=
"com.gic.auth.service.BusinessFrontResApiService"
ref=
"businessFrontResApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.application.center.api.service.AuthorizeService"
id=
"authorizeService"
timeout=
"6000"
/>
<!-- 渠道资源 -->
<!--渠道资源-->
<dubbo:reference
interface=
"com.gic.member.config.api.service.MemberCardApiService"
id=
"memberCardApiService"
timeout=
"60000"
/>
<dubbo:reference
interface=
"com.gic.member.config.api.service.AppletsConfigApiService"
id=
"appletsConfigApiService"
timeout=
"60000"
/>
<dubbo:reference
interface=
"com.gic.member.config.api.service.ServiceConfigApiService"
id=
"serviceConfigApiService"
timeout=
"60000"
/>
</beans>
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