diff options
Diffstat (limited to 'src/main/java/com/juick/service')
32 files changed, 94 insertions, 93 deletions
diff --git a/src/main/java/com/juick/service/ActivityPubService.java b/src/main/java/com/juick/service/ActivityPubService.java index e1091748..e98b1c75 100644 --- a/src/main/java/com/juick/service/ActivityPubService.java +++ b/src/main/java/com/juick/service/ActivityPubService.java @@ -17,7 +17,7 @@ package com.juick.service; -import com.juick.User; +import com.juick.model.User; import com.juick.model.AnonymousUser; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/juick/service/CrosspostService.java b/src/main/java/com/juick/service/CrosspostService.java index d22f244a..66e10737 100644 --- a/src/main/java/com/juick/service/CrosspostService.java +++ b/src/main/java/com/juick/service/CrosspostService.java @@ -17,7 +17,7 @@ package com.juick.service; -import com.juick.ExternalToken; +import com.juick.model.ExternalToken; import com.juick.model.ApplicationStatus; import org.apache.commons.lang3.tuple.Pair; diff --git a/src/main/java/com/juick/service/CrosspostServiceImpl.java b/src/main/java/com/juick/service/CrosspostServiceImpl.java index 3b00c219..3fe21588 100644 --- a/src/main/java/com/juick/service/CrosspostServiceImpl.java +++ b/src/main/java/com/juick/service/CrosspostServiceImpl.java @@ -17,7 +17,7 @@ package com.juick.service; -import com.juick.ExternalToken; +import com.juick.model.ExternalToken; import com.juick.model.ApplicationStatus; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Pair; diff --git a/src/main/java/com/juick/service/ImagesService.java b/src/main/java/com/juick/service/ImagesService.java index 7aa4b411..7288937f 100644 --- a/src/main/java/com/juick/service/ImagesService.java +++ b/src/main/java/com/juick/service/ImagesService.java @@ -17,7 +17,7 @@ package com.juick.service; -import com.juick.Message; +import com.juick.model.Message; import java.io.IOException; diff --git a/src/main/java/com/juick/service/ImagesServiceImpl.java b/src/main/java/com/juick/service/ImagesServiceImpl.java index 7cdb8d60..abaec940 100644 --- a/src/main/java/com/juick/service/ImagesServiceImpl.java +++ b/src/main/java/com/juick/service/ImagesServiceImpl.java @@ -17,9 +17,9 @@ package com.juick.service; -import com.juick.Attachment; -import com.juick.Message; -import com.juick.Photo; +import com.juick.model.Attachment; +import com.juick.model.Message; +import com.juick.model.Photo; import com.juick.server.util.ImageUtils; import org.springframework.util.StringUtils; diff --git a/src/main/java/com/juick/service/MessagesService.java b/src/main/java/com/juick/service/MessagesService.java index e6e039d3..3e3e027d 100644 --- a/src/main/java/com/juick/service/MessagesService.java +++ b/src/main/java/com/juick/service/MessagesService.java @@ -17,10 +17,11 @@ package com.juick.service; -import com.juick.Message; -import com.juick.Reaction; -import com.juick.User; +import com.juick.model.Message; +import com.juick.model.Reaction; +import com.juick.model.User; import com.juick.model.ResponseReply; +import com.juick.model.Tag; import org.apache.commons.lang3.tuple.Pair; import java.net.URI; @@ -30,7 +31,7 @@ import java.util.*; * Created by aalexeev on 11/13/16. */ public interface MessagesService { - int createMessage(int uid, String txt, String attachment, List<com.juick.Tag> tags); + int createMessage(int uid, String txt, String attachment, List<Tag> tags); int createReply(int mid, int rid, User user, String txt, String attachment); enum RecommendStatus { @@ -60,9 +61,9 @@ public interface MessagesService { Optional<Message> getMessage(int mid); - com.juick.Message getReply(int mid, int rid); + Message getReply(int mid, int rid); - com.juick.Message getReplyByUri(String replyUri); + Message getReplyByUri(String replyUri); User getMessageAuthor(int mid); @@ -104,11 +105,11 @@ public interface MessagesService { List<Integer> getUserSearch(User visitor, int UID, String search, int privacy, int page); - List<com.juick.Message> getMessages(User visitor, List<Integer> mids); + List<Message> getMessages(User visitor, List<Integer> mids); Map<Integer,Set<Reaction>> updateReactionsFor(final List<Integer> mid); - List<com.juick.Message> getReplies(User user, int mid); + List<Message> getReplies(User user, int mid); boolean setMessagePopular(int mid, int popular); diff --git a/src/main/java/com/juick/service/MessagesServiceImpl.java b/src/main/java/com/juick/service/MessagesServiceImpl.java index 8f1387cf..e2b5e2b1 100644 --- a/src/main/java/com/juick/service/MessagesServiceImpl.java +++ b/src/main/java/com/juick/service/MessagesServiceImpl.java @@ -17,12 +17,8 @@ package com.juick.service; -import com.juick.Message; -import com.juick.Reaction; -import com.juick.User; -import com.juick.model.AnonymousUser; -import com.juick.model.PrivacyOpts; -import com.juick.model.ResponseReply; +import com.juick.model.*; +import com.juick.model.User; import com.juick.server.www.WebApp; import com.juick.util.MessageUtils; import org.apache.commons.collections4.CollectionUtils; @@ -134,7 +130,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ */ @Transactional @Override - public int createMessage(final int uid, final String txt, final String attachment, final List<com.juick.Tag> tags) { + public int createMessage(final int uid, final String txt, final String attachment, final List<Tag> tags) { SimpleJdbcInsert simpleJdbcInsert = new SimpleJdbcInsert(getJdbcTemplate()).withTableName("messages") .usingColumns("user_id", "attach", "ts") .usingGeneratedKeyColumns("message_id"); @@ -370,9 +366,9 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ @Transactional(readOnly = true) @Override - public Optional<com.juick.Message> getMessage(final int mid) { + public Optional<Message> getMessage(final int mid) { - List<com.juick.Message> list = getJdbcTemplate().query( + List<Message> list = getJdbcTemplate().query( "SELECT messages.message_id as mid, 0 as rid, 0 as replyto, " + "messages.user_id as uid, users.nick, users.banned as banned, " + "" @@ -405,8 +401,8 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ @Transactional(readOnly = true) @Override - public com.juick.Message getReply(final int mid, final int rid) { - List<com.juick.Message> list = getJdbcTemplate().query( + public Message getReply(final int mid, final int rid) { + List<Message> list = getJdbcTemplate().query( "SELECT replies.user_id, users.nick," + "replies.replyto, replies.ts," + "replies.attach, replies.txt, IFNULL(q.txt,t.txt) as quote, " @@ -481,7 +477,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ + "FROM messages INNER JOIN users ON messages.user_id = users.id WHERE messages.message_id = ?", new Object[]{mid}, (rs, num) -> { - User res = new com.juick.User(); + User res = new User(); res.setUid(rs.getInt(1)); res.setName(rs.getString(2)); return res; @@ -875,10 +871,10 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ @Transactional(readOnly = true) @Override - public List<com.juick.Message> getMessages(final User visitor, final List<Integer> mids) { + public List<Message> getMessages(final User visitor, final List<Integer> mids) { if (CollectionUtils.isNotEmpty(mids)) { - List<com.juick.Message> msgs = getNamedParameterJdbcTemplate().query( + List<Message> msgs = getNamedParameterJdbcTemplate().query( "WITH RECURSIVE banned(message_id, reply_id) " + "AS (SELECT message_id, reply_id FROM replies WHERE replies.message_id IN (:ids) " + "AND (EXISTS (SELECT 1 FROM bl_users b WHERE b.user_id = :uid AND b.bl_user_id = replies.user_id) " diff --git a/src/main/java/com/juick/service/PMQueriesService.java b/src/main/java/com/juick/service/PMQueriesService.java index 4f748758..aa5ec794 100644 --- a/src/main/java/com/juick/service/PMQueriesService.java +++ b/src/main/java/com/juick/service/PMQueriesService.java @@ -17,8 +17,9 @@ package com.juick.service; -import com.juick.Chat; -import com.juick.User; +import com.juick.model.Chat; +import com.juick.model.User; +import com.juick.model.Message; import java.util.List; @@ -36,9 +37,9 @@ public interface PMQueriesService { List<Chat> getLastChats(User user); - List<com.juick.Message> getPMMessages(int uid, int uidTo); + List<Message> getPMMessages(int uid, int uidTo); - List<com.juick.Message> getLastPMInbox(int uid); + List<Message> getLastPMInbox(int uid); - List<com.juick.Message> getLastPMSent(int uid); + List<Message> getLastPMSent(int uid); } diff --git a/src/main/java/com/juick/service/PMQueriesServiceImpl.java b/src/main/java/com/juick/service/PMQueriesServiceImpl.java index c4ffc269..903529fb 100644 --- a/src/main/java/com/juick/service/PMQueriesServiceImpl.java +++ b/src/main/java/com/juick/service/PMQueriesServiceImpl.java @@ -17,8 +17,9 @@ package com.juick.service; -import com.juick.Chat; -import com.juick.User; +import com.juick.model.Chat; +import com.juick.model.User; +import com.juick.model.Message; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.jdbc.core.namedparam.SqlParameterSource; import org.springframework.stereotype.Repository; @@ -76,7 +77,7 @@ public class PMQueriesServiceImpl extends BaseJdbcService implements PMQueriesSe + "WHERE pm.user_id_to=? " + "ORDER BY l.last DESC", (rs, rowNum) -> { - com.juick.Chat u = new com.juick.Chat(); + Chat u = new Chat(); u.setUid(rs.getInt(1)); u.setName(rs.getString(2)); u.setLastMessageTimestamp(rs.getTimestamp(3).toInstant()); @@ -88,7 +89,7 @@ public class PMQueriesServiceImpl extends BaseJdbcService implements PMQueriesSe @Transactional @Override - public List<com.juick.Message> getPMMessages(final int uid, final int uidTo) { + public List<Message> getPMMessages(final int uid, final int uidTo) { SqlParameterSource sqlParameterSource = new MapSqlParameterSource() .addValue("uid", uid) .addValue("uidTo", uidTo); @@ -98,7 +99,7 @@ public class PMQueriesServiceImpl extends BaseJdbcService implements PMQueriesSe + "OR (user_id_to = :uid AND user_id = :uidTo) ORDER BY ts DESC LIMIT 20", sqlParameterSource, (rs, rowNum) -> { - com.juick.Message msg = new com.juick.Message(); + Message msg = new Message(); int uuid = rs.getInt(1); User user = new User(); user.setUid(uuid); @@ -112,12 +113,12 @@ public class PMQueriesServiceImpl extends BaseJdbcService implements PMQueriesSe @Transactional(readOnly = true) @Override - public List<com.juick.Message> getLastPMInbox(final int uid) { + public List<Message> getLastPMInbox(final int uid) { return getJdbcTemplate().query( "SELECT pm.user_id, users.nick, pm.txt, pm.ts " + "FROM pm INNER JOIN users ON pm.user_id=users.id WHERE pm.user_id_to=? ORDER BY pm.ts DESC LIMIT 20", (rs, num) -> { - com.juick.Message msg = new com.juick.Message(); + Message msg = new Message(); msg.setUser(new User()); msg.getUser().setUid(rs.getInt(1)); msg.getUser().setName(rs.getString(2)); @@ -130,13 +131,13 @@ public class PMQueriesServiceImpl extends BaseJdbcService implements PMQueriesSe @Transactional(readOnly = true) @Override - public List<com.juick.Message> getLastPMSent(final int uid) { + public List<Message> getLastPMSent(final int uid) { return getJdbcTemplate().query( "SELECT pm.user_id_to, users.nick, pm.txt, " + "pm.ts FROM pm INNER JOIN users ON pm.user_id_to=users.id " + "WHERE pm.user_id=? ORDER BY pm.ts DESC LIMIT 20", (rs, num) -> { - com.juick.Message msg = new com.juick.Message(); + Message msg = new Message(); msg.setUser(new User()); msg.getUser().setUid(rs.getInt(1)); msg.getUser().setName(rs.getString(2)); diff --git a/src/main/java/com/juick/service/PrivacyQueriesService.java b/src/main/java/com/juick/service/PrivacyQueriesService.java index 52ba5485..e8f6b089 100644 --- a/src/main/java/com/juick/service/PrivacyQueriesService.java +++ b/src/main/java/com/juick/service/PrivacyQueriesService.java @@ -17,8 +17,8 @@ package com.juick.service; -import com.juick.Tag; -import com.juick.User; +import com.juick.model.Tag; +import com.juick.model.User; /** * Created by aalexeev on 11/13/16. diff --git a/src/main/java/com/juick/service/PrivacyQueriesServiceImpl.java b/src/main/java/com/juick/service/PrivacyQueriesServiceImpl.java index c8702edf..3696b4e4 100644 --- a/src/main/java/com/juick/service/PrivacyQueriesServiceImpl.java +++ b/src/main/java/com/juick/service/PrivacyQueriesServiceImpl.java @@ -17,8 +17,8 @@ package com.juick.service; -import com.juick.Tag; -import com.juick.User; +import com.juick.model.Tag; +import com.juick.model.User; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/com/juick/service/SearchService.java b/src/main/java/com/juick/service/SearchService.java index ab27cc12..fbcb61a9 100644 --- a/src/main/java/com/juick/service/SearchService.java +++ b/src/main/java/com/juick/service/SearchService.java @@ -17,7 +17,7 @@ package com.juick.service; -import com.juick.User; +import com.juick.model.User; import java.util.List; diff --git a/src/main/java/com/juick/service/ShowQueriesService.java b/src/main/java/com/juick/service/ShowQueriesService.java index 3b1f712f..4fcbe7d5 100644 --- a/src/main/java/com/juick/service/ShowQueriesService.java +++ b/src/main/java/com/juick/service/ShowQueriesService.java @@ -17,7 +17,7 @@ package com.juick.service; -import com.juick.User; +import com.juick.model.User; import java.util.List; diff --git a/src/main/java/com/juick/service/ShowQueriesServiceImpl.java b/src/main/java/com/juick/service/ShowQueriesServiceImpl.java index 54661e64..c5d669bb 100644 --- a/src/main/java/com/juick/service/ShowQueriesServiceImpl.java +++ b/src/main/java/com/juick/service/ShowQueriesServiceImpl.java @@ -17,7 +17,7 @@ package com.juick.service; -import com.juick.User; +import com.juick.model.User; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/com/juick/service/SocialService.java b/src/main/java/com/juick/service/SocialService.java index 5fe170cd..9d66ff3a 100644 --- a/src/main/java/com/juick/service/SocialService.java +++ b/src/main/java/com/juick/service/SocialService.java @@ -17,7 +17,7 @@ package com.juick.service; -import com.juick.User; +import com.juick.model.User; import javax.annotation.Nonnull; import java.util.List; diff --git a/src/main/java/com/juick/service/SphinxSearchService.java b/src/main/java/com/juick/service/SphinxSearchService.java index 049dc7cc..dd06c485 100644 --- a/src/main/java/com/juick/service/SphinxSearchService.java +++ b/src/main/java/com/juick/service/SphinxSearchService.java @@ -17,7 +17,7 @@ package com.juick.service; -import com.juick.User; +import com.juick.model.User; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/com/juick/service/SubscriptionService.java b/src/main/java/com/juick/service/SubscriptionService.java index 51e639ec..3dcc285e 100644 --- a/src/main/java/com/juick/service/SubscriptionService.java +++ b/src/main/java/com/juick/service/SubscriptionService.java @@ -17,9 +17,9 @@ package com.juick.service; -import com.juick.Message; -import com.juick.Tag; -import com.juick.User; +import com.juick.model.Message; +import com.juick.model.Tag; +import com.juick.model.User; import com.juick.model.NotifyOpts; import java.util.List; diff --git a/src/main/java/com/juick/service/SubscriptionServiceImpl.java b/src/main/java/com/juick/service/SubscriptionServiceImpl.java index 4f0a4568..977fbec0 100644 --- a/src/main/java/com/juick/service/SubscriptionServiceImpl.java +++ b/src/main/java/com/juick/service/SubscriptionServiceImpl.java @@ -17,9 +17,9 @@ package com.juick.service; -import com.juick.Message; -import com.juick.Tag; -import com.juick.User; +import com.juick.model.Message; +import com.juick.model.Tag; +import com.juick.model.User; import com.juick.model.NotifyOpts; import com.juick.util.MessageUtils; import org.apache.commons.collections4.CollectionUtils; diff --git a/src/main/java/com/juick/service/TagService.java b/src/main/java/com/juick/service/TagService.java index 741249a9..3c77e3e6 100644 --- a/src/main/java/com/juick/service/TagService.java +++ b/src/main/java/com/juick/service/TagService.java @@ -17,8 +17,8 @@ package com.juick.service; -import com.juick.Tag; -import com.juick.User; +import com.juick.model.Tag; +import com.juick.model.User; import com.juick.model.TagStats; import org.apache.commons.lang3.tuple.Pair; diff --git a/src/main/java/com/juick/service/TagServiceImpl.java b/src/main/java/com/juick/service/TagServiceImpl.java index 95a1a309..438438b0 100644 --- a/src/main/java/com/juick/service/TagServiceImpl.java +++ b/src/main/java/com/juick/service/TagServiceImpl.java @@ -17,8 +17,8 @@ package com.juick.service; -import com.juick.Tag; -import com.juick.User; +import com.juick.model.Tag; +import com.juick.model.User; import com.juick.model.TagStats; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -52,7 +52,7 @@ public class TagServiceImpl extends BaseJdbcService implements TagService { @Transactional(readOnly = true) @Override - public com.juick.Tag getTag(final int tid) { + public Tag getTag(final int tid) { List<Tag> list = getJdbcTemplate().query( "SELECT synonym_id,name FROM tags WHERE tag_id=?", (rs, num) -> { @@ -69,7 +69,7 @@ public class TagServiceImpl extends BaseJdbcService implements TagService { @Transactional @Override - public com.juick.Tag getTag(final String tag, final boolean autoCreate) { + public Tag getTag(final String tag, final boolean autoCreate) { if (StringUtils.isBlank(tag)) return null; @@ -87,7 +87,7 @@ public class TagServiceImpl extends BaseJdbcService implements TagService { null : list.get(0); if (ret == null && autoCreate) { - ret = new com.juick.Tag(tag); + ret = new Tag(tag); ret.TID = createTag(tag); } @@ -236,7 +236,7 @@ public class TagServiceImpl extends BaseJdbcService implements TagService { "SELECT tags.tag_id,synonym_id,name,stat_messages FROM tags " + "INNER JOIN messages_tags ON (messages_tags.message_id = ? AND messages_tags.tag_id = tags.tag_id)", (rs, num) -> { - com.juick.Tag t = new com.juick.Tag(rs.getString(3)); + Tag t = new Tag(rs.getString(3)); t.TID = rs.getInt(1); t.SynonymID = rs.getInt(2); TagStats s = new TagStats(); diff --git a/src/main/java/com/juick/service/TelegramService.java b/src/main/java/com/juick/service/TelegramService.java index 9fb55022..1b742c39 100644 --- a/src/main/java/com/juick/service/TelegramService.java +++ b/src/main/java/com/juick/service/TelegramService.java @@ -17,7 +17,7 @@ package com.juick.service; -import com.juick.User; +import com.juick.model.User; import java.util.List; diff --git a/src/main/java/com/juick/service/TelegramServiceImpl.java b/src/main/java/com/juick/service/TelegramServiceImpl.java index 52e17307..04f4b47c 100644 --- a/src/main/java/com/juick/service/TelegramServiceImpl.java +++ b/src/main/java/com/juick/service/TelegramServiceImpl.java @@ -17,7 +17,7 @@ package com.juick.service; -import com.juick.User; +import com.juick.model.User; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/com/juick/service/UserService.java b/src/main/java/com/juick/service/UserService.java index 71b38594..e171126d 100644 --- a/src/main/java/com/juick/service/UserService.java +++ b/src/main/java/com/juick/service/UserService.java @@ -17,8 +17,8 @@ package com.juick.service; -import com.juick.Message; -import com.juick.User; +import com.juick.model.Message; +import com.juick.model.User; import com.juick.model.AuthResponse; import javax.annotation.Nonnull; @@ -61,7 +61,8 @@ public interface UserService { int getUIDbyHash(String hash); - @Nonnull com.juick.User getUserByHash(String hash); + @Nonnull + User getUserByHash(String hash); String getHashByUID(int uid); @@ -91,7 +92,7 @@ public interface UserService { boolean isSubscribed(int uid, int check); - List<com.juick.User> getUserReadLeastPopular(int uid, int cnt); + List<User> getUserReadLeastPopular(int uid, int cnt); List<User> getUserReaders(int uid); @@ -99,7 +100,7 @@ public interface UserService { Integer getUserRecommendations(User user); - List<com.juick.User> getUserBLUsers(int uid); + List<User> getUserBLUsers(int uid); boolean linkTwitterAccount(User user, String accessToken, String accessTokenSecret, String screenName); diff --git a/src/main/java/com/juick/service/UserServiceImpl.java b/src/main/java/com/juick/service/UserServiceImpl.java index 9f01b4db..084f3a00 100644 --- a/src/main/java/com/juick/service/UserServiceImpl.java +++ b/src/main/java/com/juick/service/UserServiceImpl.java @@ -17,8 +17,8 @@ package com.juick.service; -import com.juick.Message; -import com.juick.User; +import com.juick.model.Message; +import com.juick.model.User; import com.juick.model.AnonymousUser; import com.juick.model.AuthResponse; import org.apache.commons.collections4.CollectionUtils; @@ -284,7 +284,7 @@ public class UserServiceImpl extends BaseJdbcService implements UserService { @Transactional(readOnly = true) @Override - public com.juick.User getUserByHash(final String hash) { + public User getUserByHash(final String hash) { if (StringUtils.isNotBlank(hash)) { List<User> list = getJdbcTemplate().query( "SELECT DISTINCT logins.user_id, u.nick, u.passw, u.banned, u.last_seen," + @@ -504,14 +504,14 @@ public class UserServiceImpl extends BaseJdbcService implements UserService { @Transactional(readOnly = true) @Override - public List<com.juick.User> getUserReadLeastPopular(final int uid, final int cnt) { + public List<User> getUserReadLeastPopular(final int uid, final int cnt) { return getJdbcTemplate().query( "SELECT users.id,users.nick FROM (subscr_users " + "INNER JOIN users_subscr ON (subscr_users.suser_id=? " + "AND subscr_users.user_id=users_subscr.user_id)) INNER JOIN users " + "ON subscr_users.user_id=users.id ORDER BY cnt LIMIT ?", (rs, num) -> { - com.juick.User u = new com.juick.User(); + User u = new User(); u.setUid(rs.getInt(1)); u.setName(rs.getString(2)); return u; @@ -528,7 +528,7 @@ public class UserServiceImpl extends BaseJdbcService implements UserService { "INNER JOIN users ON subscr_users.suser_id=users.id " + "WHERE subscr_users.user_id=? ORDER BY users.nick", (rs, num) -> { - com.juick.User u = new com.juick.User(); + User u = new User(); u.setUid(rs.getInt(1)); u.setName(rs.getString(2)); return u; @@ -545,7 +545,7 @@ public class UserServiceImpl extends BaseJdbcService implements UserService { "WHERE subscr_users.suser_id=? AND users.id!=? " + "ORDER BY users.nick", (rs, num) -> { - com.juick.User u = new com.juick.User(); + User u = new User(); u.setUid(rs.getInt(1)); u.setName(rs.getString(2)); return u; @@ -566,11 +566,11 @@ public class UserServiceImpl extends BaseJdbcService implements UserService { @Transactional(readOnly = true) @Override - public List<com.juick.User> getUserBLUsers(final int uid) { + public List<User> getUserBLUsers(final int uid) { return getJdbcTemplate().query("SELECT users.id,users.nick FROM users INNER JOIN bl_users " + "ON(bl_users.bl_user_id=users.id) WHERE bl_users.user_id=? ORDER BY users.nick", (rs, num) -> { - com.juick.User u = new com.juick.User(); + User u = new User(); u.setUid(rs.getInt(1)); u.setName(rs.getString(2)); return u; diff --git a/src/main/java/com/juick/service/activities/DeleteMessageEvent.java b/src/main/java/com/juick/service/activities/DeleteMessageEvent.java index c858ec72..8ca75122 100644 --- a/src/main/java/com/juick/service/activities/DeleteMessageEvent.java +++ b/src/main/java/com/juick/service/activities/DeleteMessageEvent.java @@ -17,7 +17,7 @@ package com.juick.service.activities; -import com.juick.Message; +import com.juick.model.Message; import org.springframework.context.ApplicationEvent; public class DeleteMessageEvent extends ApplicationEvent { diff --git a/src/main/java/com/juick/service/activities/UpdateEvent.java b/src/main/java/com/juick/service/activities/UpdateEvent.java index 0d02e80b..59833c8d 100644 --- a/src/main/java/com/juick/service/activities/UpdateEvent.java +++ b/src/main/java/com/juick/service/activities/UpdateEvent.java @@ -17,7 +17,7 @@ package com.juick.service.activities; -import com.juick.User; +import com.juick.model.User; import org.springframework.context.ApplicationEvent; public class UpdateEvent extends ApplicationEvent { diff --git a/src/main/java/com/juick/service/component/PingEvent.java b/src/main/java/com/juick/service/component/PingEvent.java index e7e4a3c7..45a63dd7 100644 --- a/src/main/java/com/juick/service/component/PingEvent.java +++ b/src/main/java/com/juick/service/component/PingEvent.java @@ -17,7 +17,7 @@ package com.juick.service.component; -import com.juick.User; +import com.juick.model.User; import org.springframework.context.ApplicationEvent; public class PingEvent extends ApplicationEvent { diff --git a/src/main/java/com/juick/service/component/UserUpdatedEvent.java b/src/main/java/com/juick/service/component/UserUpdatedEvent.java index cbb96da8..f22a5a43 100644 --- a/src/main/java/com/juick/service/component/UserUpdatedEvent.java +++ b/src/main/java/com/juick/service/component/UserUpdatedEvent.java @@ -17,7 +17,7 @@ package com.juick.service.component; -import com.juick.User; +import com.juick.model.User; import org.springframework.context.ApplicationEvent; import org.springframework.lang.NonNull; diff --git a/src/main/java/com/juick/service/security/HTTPSignatureAuthenticationFilter.java b/src/main/java/com/juick/service/security/HTTPSignatureAuthenticationFilter.java index 01a35695..1b3cb936 100644 --- a/src/main/java/com/juick/service/security/HTTPSignatureAuthenticationFilter.java +++ b/src/main/java/com/juick/service/security/HTTPSignatureAuthenticationFilter.java @@ -17,7 +17,7 @@ package com.juick.service.security; -import com.juick.User; +import com.juick.model.User; import com.juick.server.SignatureManager; import com.juick.service.UserService; import com.juick.service.security.entities.JuickUser; diff --git a/src/main/java/com/juick/service/security/HashParamAuthenticationFilter.java b/src/main/java/com/juick/service/security/HashParamAuthenticationFilter.java index 3dc58782..68ae91ee 100644 --- a/src/main/java/com/juick/service/security/HashParamAuthenticationFilter.java +++ b/src/main/java/com/juick/service/security/HashParamAuthenticationFilter.java @@ -17,7 +17,7 @@ package com.juick.service.security; -import com.juick.User; +import com.juick.model.User; import com.juick.service.UserService; import com.juick.service.security.entities.JuickUser; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/com/juick/service/security/JuickUserDetailsService.java b/src/main/java/com/juick/service/security/JuickUserDetailsService.java index fd539a8c..a62bdadd 100644 --- a/src/main/java/com/juick/service/security/JuickUserDetailsService.java +++ b/src/main/java/com/juick/service/security/JuickUserDetailsService.java @@ -17,6 +17,7 @@ package com.juick.service.security; +import com.juick.model.User; import com.juick.service.UserService; import com.juick.service.security.entities.JuickUser; import org.apache.commons.lang3.StringUtils; @@ -41,7 +42,7 @@ public class JuickUserDetailsService implements UserDetailsService { if (StringUtils.isBlank(username)) throw new UsernameNotFoundException("Invalid user name " + username); - com.juick.User user = userService.getUserByName(username); + User user = userService.getUserByName(username); if (!user.isAnonymous()) { user.setAuthHash(userService.getHashByUID(user.getUid())); diff --git a/src/main/java/com/juick/service/security/entities/JuickUser.java b/src/main/java/com/juick/service/security/entities/JuickUser.java index eb2e43dc..062db3a4 100644 --- a/src/main/java/com/juick/service/security/entities/JuickUser.java +++ b/src/main/java/com/juick/service/security/entities/JuickUser.java @@ -17,7 +17,7 @@ package com.juick.service.security.entities; -import com.juick.User; +import com.juick.model.User; import com.juick.model.AnonymousUser; import org.apache.commons.lang3.StringUtils; import org.springframework.security.core.GrantedAuthority; @@ -40,14 +40,14 @@ public class JuickUser implements UserDetails { public static final JuickUser ANONYMOUS_USER = new JuickUser(AnonymousUser.INSTANCE, ANONYMOUS_AUTHORITY); - private final com.juick.User user; + private final User user; private final Collection<? extends GrantedAuthority> authorities; - public JuickUser(com.juick.User user) { + public JuickUser(User user) { this(user, USER_AUTHORITY); } - public JuickUser(com.juick.User user, Collection<? extends GrantedAuthority> authorities) { + public JuickUser(User user, Collection<? extends GrantedAuthority> authorities) { this.user = user; this.authorities = authorities; } |