diff options
author | Vitaly Takmazov | 2023-01-22 21:14:18 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-22 21:14:18 +0300 |
commit | b6db99da90ae4202ec58974a1e237aac6570e8a9 (patch) | |
tree | 684b4472e69c23b994730b2de6c2656dcea5ca62 /src/main/java/com/juick | |
parent | b08f5b104bdd98e2b422420479a1a962a4fb9d78 (diff) |
`isInBL`: do not check anonymous user
Diffstat (limited to 'src/main/java/com/juick')
-rw-r--r-- | src/main/java/com/juick/service/UserServiceImpl.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/com/juick/service/UserServiceImpl.java b/src/main/java/com/juick/service/UserServiceImpl.java index 99e56229..5ae0b2d1 100644 --- a/src/main/java/com/juick/service/UserServiceImpl.java +++ b/src/main/java/com/juick/service/UserServiceImpl.java @@ -370,10 +370,13 @@ public class UserServiceImpl extends BaseJdbcService implements UserService { @Transactional(readOnly = true) @Override public boolean isInBL(final int uid, final int check) { - List<Integer> list = getJdbcTemplate().queryForList( - "SELECT 1 FROM bl_users WHERE user_id = ? AND bl_user_id = ?", Integer.class, uid, check); + if (check > 0) { + List<Integer> list = getJdbcTemplate().queryForList( + "SELECT 1 FROM bl_users WHERE user_id = ? AND bl_user_id = ?", Integer.class, uid, check); - return !list.isEmpty() && list.get(0) == 1; + return !list.isEmpty() && list.get(0) == 1; + } + return false; } @Transactional(readOnly = true) |