-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix search user duplication issue #4371
fix search user duplication issue #4371
Conversation
fd7f33b
to
ac943a7
Compare
Codecov Report
@@ Coverage Diff @@
## master #4371 +/- ##
============================================
- Coverage 53.19% 53.19% -0.01%
- Complexity 2671 2673 +2
============================================
Files 489 489
Lines 15267 15275 +8
Branches 1576 1580 +4
============================================
+ Hits 8121 8125 +4
- Misses 6593 6597 +4
Partials 553 553
Continue to review full report at Codecov.
|
the ...
Map<Long, UserPO> users = new HashMap<>();
List<UserPO> byUsername = userRepository
.findByUsernameLikeAndEnabled("%" + keyword + "%", 1);
List<UserPO> byUserDisplayName = userRepository
.findByUserDisplayNameLikeAndEnabled("%" + keyword + "%", 1);
if (!CollectionUtils.isEmpty(byUsername)) {
for (UserPO user : byUsername) {
users.put(user.getId(), user);
}
}
if (!CollectionUtils.isEmpty(byUserDisplayName)) {
for (UserPO user : byUserDisplayName) {
users.put(user.getId(), user);
}
}
return new ArrayList<>(users.values()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What's the purpose of this PR
fix search user duplication issue
Which issue(s) this PR fixes:
Fixes #4370
Brief changelog
Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean test
to make sure this pull request doesn't break anything.CHANGES
log.