Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apollo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
apollo
Commits
5ccb5d1f
Commit
5ccb5d1f
authored
Jul 24, 2018
by
nobodyiam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement find users for spring security user service
parent
0bc91cc1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/repository/UserRepository.java
...ip/framework/apollo/portal/repository/UserRepository.java
+2
-0
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/springsecurity/SpringSecurityUserService.java
.../portal/spi/springsecurity/SpringSecurityUserService.java
+12
-1
No files found.
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/repository/UserRepository.java
View file @
5ccb5d1f
...
@@ -16,4 +16,6 @@ public interface UserRepository extends PagingAndSortingRepository<UserPO, Long>
...
@@ -16,4 +16,6 @@ public interface UserRepository extends PagingAndSortingRepository<UserPO, Long>
List
<
UserPO
>
findByUsernameLikeAndEnabled
(
String
username
,
int
enabled
);
List
<
UserPO
>
findByUsernameLikeAndEnabled
(
String
username
,
int
enabled
);
UserPO
findByUsername
(
String
username
);
UserPO
findByUsername
(
String
username
);
List
<
UserPO
>
findByUsernameIn
(
List
<
String
>
userNames
);
}
}
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/springsecurity/SpringSecurityUserService.java
View file @
5ccb5d1f
...
@@ -8,6 +8,7 @@ import com.ctrip.framework.apollo.portal.entity.po.UserPO;
...
@@ -8,6 +8,7 @@ import com.ctrip.framework.apollo.portal.entity.po.UserPO;
import
com.ctrip.framework.apollo.portal.repository.UserRepository
;
import
com.ctrip.framework.apollo.portal.repository.UserRepository
;
import
com.ctrip.framework.apollo.portal.spi.UserService
;
import
com.ctrip.framework.apollo.portal.spi.UserService
;
import
java.util.Collections
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.authority.SimpleGrantedAuthority
;
import
org.springframework.security.core.authority.SimpleGrantedAuthority
;
...
@@ -88,7 +89,17 @@ public class SpringSecurityUserService implements UserService {
...
@@ -88,7 +89,17 @@ public class SpringSecurityUserService implements UserService {
@Override
@Override
public
List
<
UserInfo
>
findByUserIds
(
List
<
String
>
userIds
)
{
public
List
<
UserInfo
>
findByUserIds
(
List
<
String
>
userIds
)
{
return
null
;
List
<
UserPO
>
users
=
userRepository
.
findByUsernameIn
(
userIds
);
if
(
CollectionUtils
.
isEmpty
(
users
))
{
return
Collections
.
emptyList
();
}
List
<
UserInfo
>
result
=
Lists
.
newArrayList
();
result
.
addAll
(
users
.
stream
().
map
(
UserPO:
:
toUserInfo
).
collect
(
Collectors
.
toList
()));
return
result
;
}
}
...
...
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