From 1679b35661297fd9a6693b03cadcdbc1ab5a4203 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 28 Nov 2016 13:09:34 +0300 Subject: juick-api: all controllers are using spring-security and @RequestParam --- juick-server/src/main/java/com/juick/service/UserServiceImpl.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'juick-server/src/main/java/com/juick/service') diff --git a/juick-server/src/main/java/com/juick/service/UserServiceImpl.java b/juick-server/src/main/java/com/juick/service/UserServiceImpl.java index a00eab3f..b3430254 100644 --- a/juick-server/src/main/java/com/juick/service/UserServiceImpl.java +++ b/juick-server/src/main/java/com/juick/service/UserServiceImpl.java @@ -118,16 +118,15 @@ public class UserServiceImpl extends BaseJdbcService implements UserService { @Transactional(readOnly = true) @Override public User getUserByName(final String username) { - User result = null; - if (StringUtils.isNotBlank(username)) { List list = getJdbcTemplate().query( "SELECT id, nick, banned, lang FROM users WHERE nick = ?", new UserMapper(), username); if (!list.isEmpty()) - result = list.get(0); + return list.get(0); } - return result; + // TODO: @NonNullable ? + return new User(); } @Override -- cgit v1.2.3