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
02148cb3
Commit
02148cb3
authored
Jan 18, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
33d0378c
0beb12a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
2 deletions
+42
-2
ResourceApiServiceImpl.java
...m/gic/auth/service/outer/impl/ResourceApiServiceImpl.java
+42
-2
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/ResourceApiServiceImpl.java
View file @
02148cb3
...
...
@@ -3,8 +3,25 @@ package com.gic.auth.service.outer.impl;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.*
;
import
com.gic.auth.entity.TabSysUser
;
import
com.gic.auth.service.ResourceApiService
;
import
com.gic.auth.service.UserService
;
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.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
/**
* 旧资源组
* @ClassName:
...
...
@@ -14,6 +31,15 @@ import org.springframework.stereotype.Service;
*/
@Service
(
"resourceApiService"
)
public
class
ResourceApiServiceImpl
implements
ResourceApiService
{
@Autowired
private
UserService
userService
;
@Autowired
private
MemberCardApiService
memberCardApiService
;
@Autowired
private
AppletsConfigApiService
appletsConfigApiService
;
@Autowired
private
ServiceConfigApiService
serviceConfigApiService
;
@Override
public
ServiceResponse
<
Integer
>
saveOrUpdateResource
(
ResourceDTO
resourceDTO
)
{
return
ServiceResponse
.
success
(
1
);
...
...
@@ -41,7 +67,21 @@ public class ResourceApiServiceImpl implements ResourceApiService{
@Override
public
ServiceResponse
<
ChannelResourceDTO
>
getChannelResourceByUserId
(
Integer
userId
)
{
return
ServiceResponse
.
success
();
TabSysUser
user
=
this
.
userService
.
getUserById
(
userId
);
if
(
user
==
null
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
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
);
}
@Override
...
...
@@ -61,6 +101,6 @@ public class ResourceApiServiceImpl implements ResourceApiService{
@Override
public
ServiceResponse
<
Long
>
getUserResourceByUserId
(
Integer
userId
)
{
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
(
-
1L
);
}
}
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