From 7aaa3f9a29c280f01c677c918932620be45cdbd7 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 8 Nov 2018 21:38:27 +0300 Subject: Merge everything into single Spring Boot application --- .../java/com/juick/service/CrosspostService.java | 86 ------------ .../main/java/com/juick/service/EmailService.java | 35 ----- .../main/java/com/juick/service/ImagesService.java | 24 ---- .../java/com/juick/service/MessagesService.java | 145 --------------------- .../java/com/juick/service/MessengerService.java | 14 -- .../java/com/juick/service/PMQueriesService.java | 44 ------- .../com/juick/service/PrivacyQueriesService.java | 34 ----- .../java/com/juick/service/PushQueriesService.java | 50 ------- .../main/java/com/juick/service/SearchService.java | 33 ----- .../java/com/juick/service/ShowQueriesService.java | 31 ----- .../main/java/com/juick/service/SocialService.java | 16 --- .../com/juick/service/SubscriptionService.java | 57 -------- .../main/java/com/juick/service/TagService.java | 64 --------- .../java/com/juick/service/TelegramService.java | 40 ------ .../main/java/com/juick/service/UserService.java | 137 ------------------- .../juick/service/component/DisconnectedEvent.java | 14 -- .../com/juick/service/component/LikeEvent.java | 36 ----- .../com/juick/service/component/MessageEvent.java | 31 ----- .../juick/service/component/MessageReadEvent.java | 30 ----- .../service/component/NotificationListener.java | 25 ---- .../com/juick/service/component/PingEvent.java | 21 --- .../juick/service/component/SubscribeEvent.java | 27 ---- .../java/com/juick/service/component/TopEvent.java | 21 --- .../juick/service/component/UserUpdatedEvent.java | 23 ---- 24 files changed, 1038 deletions(-) delete mode 100644 juick-common/src/main/java/com/juick/service/CrosspostService.java delete mode 100644 juick-common/src/main/java/com/juick/service/EmailService.java delete mode 100644 juick-common/src/main/java/com/juick/service/ImagesService.java delete mode 100644 juick-common/src/main/java/com/juick/service/MessagesService.java delete mode 100644 juick-common/src/main/java/com/juick/service/MessengerService.java delete mode 100644 juick-common/src/main/java/com/juick/service/PMQueriesService.java delete mode 100644 juick-common/src/main/java/com/juick/service/PrivacyQueriesService.java delete mode 100644 juick-common/src/main/java/com/juick/service/PushQueriesService.java delete mode 100644 juick-common/src/main/java/com/juick/service/SearchService.java delete mode 100644 juick-common/src/main/java/com/juick/service/ShowQueriesService.java delete mode 100644 juick-common/src/main/java/com/juick/service/SocialService.java delete mode 100644 juick-common/src/main/java/com/juick/service/SubscriptionService.java delete mode 100644 juick-common/src/main/java/com/juick/service/TagService.java delete mode 100644 juick-common/src/main/java/com/juick/service/TelegramService.java delete mode 100644 juick-common/src/main/java/com/juick/service/UserService.java delete mode 100644 juick-common/src/main/java/com/juick/service/component/DisconnectedEvent.java delete mode 100644 juick-common/src/main/java/com/juick/service/component/LikeEvent.java delete mode 100644 juick-common/src/main/java/com/juick/service/component/MessageEvent.java delete mode 100644 juick-common/src/main/java/com/juick/service/component/MessageReadEvent.java delete mode 100644 juick-common/src/main/java/com/juick/service/component/NotificationListener.java delete mode 100644 juick-common/src/main/java/com/juick/service/component/PingEvent.java delete mode 100644 juick-common/src/main/java/com/juick/service/component/SubscribeEvent.java delete mode 100644 juick-common/src/main/java/com/juick/service/component/TopEvent.java delete mode 100644 juick-common/src/main/java/com/juick/service/component/UserUpdatedEvent.java (limited to 'juick-common/src/main/java/com/juick/service') diff --git a/juick-common/src/main/java/com/juick/service/CrosspostService.java b/juick-common/src/main/java/com/juick/service/CrosspostService.java deleted file mode 100644 index 99911250..00000000 --- a/juick-common/src/main/java/com/juick/service/CrosspostService.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2008-2017, Juick - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package com.juick.service; - -import com.juick.ExternalToken; -import com.juick.model.ApplicationStatus; -import org.apache.commons.lang3.tuple.Pair; - -import javax.annotation.Nonnull; -import java.util.Optional; - -/** - * Created by aalexeev on 11/13/16. - */ -public interface CrosspostService { - - Optional getTwitterToken(int uid); - - boolean deleteTwitterToken(Integer uid); - - void addFacebookState(String state, String redirectUri); - - void addVKState(String state, String redirectUri); - - String verifyFacebookState(String state); - - String verifyVKState(String state); - - Optional> getFacebookTokens(int uid); - - ApplicationStatus getFbCrossPostStatus(int uid); - - boolean enableFBCrosspost(Integer uid); - - void disableFBCrosspost(Integer uid); - - @Nonnull - String getTwitterName(int uid); - - String getTelegramName(int uid); - - Optional> getVkTokens(int uid); - - void deleteVKUser(Integer uid); - - int getUIDbyFBID(long fbID); - - boolean createFacebookUser(long fbID, String loginhash, String token, String fbName, String fbLink); - - boolean updateFacebookUser(long fbID, String token, String fbName, String fbLink); - - int getUIDbyVKID(long vkID); - - boolean createVKUser(long vkID, String loginhash, String token, String vkName, String vkLink); - - String getFacebookNameByHash(String hash); - - String getTelegramNameByHash(String hash); - - boolean setFacebookUser(String hash, int uid); - - String getVKNameByHash(String hash); - - boolean setVKUser(String hash, int uid); - - boolean setTelegramUser(String hash, int uid); - - String getJIDByHash(String hash); - - boolean setJIDUser(String hash, int uid); -} diff --git a/juick-common/src/main/java/com/juick/service/EmailService.java b/juick-common/src/main/java/com/juick/service/EmailService.java deleted file mode 100644 index 0708cd96..00000000 --- a/juick-common/src/main/java/com/juick/service/EmailService.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2008-2017, Juick - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package com.juick.service; - -import java.util.List; - -/** - * Created by vitalyster on 09.12.2016. - */ -public interface EmailService { - boolean verifyAddressByCode(Integer userId, String code); - boolean addVerificationCode(Integer userId, String account, String code); - boolean addEmail(Integer userId, String email); - boolean deleteEmail(Integer userId, String account); - String getNotificationsEmail(Integer userId); - boolean setNotificationsEmail(Integer userId, String account); - List getEmails(Integer userId, boolean active); - String getEmailByAuthCode(String code); - void deleteAuthCode(String code); -} diff --git a/juick-common/src/main/java/com/juick/service/ImagesService.java b/juick-common/src/main/java/com/juick/service/ImagesService.java deleted file mode 100644 index 902301ed..00000000 --- a/juick-common/src/main/java/com/juick/service/ImagesService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.juick.service; - -import com.juick.Message; - -import java.io.IOException; - -public interface ImagesService { - void setAttachmentMetadata(String baseUrl, Message msg) throws Exception; - /** - * Move attached image from temp folder to image folder. - * Create preview images in corresponding folders. - * - * @param tempFilename Name of the image file in the temp folder. - * @param outputFilename Name that will be used in the image folder. - */ - void saveImageWithPreviews(String tempFilename, String outputFilename) throws IOException; - /** - * Save new avatar in all required sizes. - * - * @param tempFilename Name of the image file in the temp folder. - * @param uid User id that is used to build image file names. - */ - void saveAvatar(String tempFilename, int uid) throws IOException; -} diff --git a/juick-common/src/main/java/com/juick/service/MessagesService.java b/juick-common/src/main/java/com/juick/service/MessagesService.java deleted file mode 100644 index 362501b5..00000000 --- a/juick-common/src/main/java/com/juick/service/MessagesService.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (C) 2008-2017, Juick - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package com.juick.service; - -import com.juick.Message; -import com.juick.Reaction; -import com.juick.User; -import com.juick.model.ResponseReply; - -import java.net.URI; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * Created by aalexeev on 11/13/16. - */ -public interface MessagesService { - int createMessage(int uid, String txt, String attachment, Collection tags); - - int createReply(int mid, int rid, User user, String txt, String attachment); - - int getReplyIDIncrement(int mid); - - enum RecommendStatus { - Error, - Added, - Deleted - } - - RecommendStatus recommendMessage(int mid, int vuid, String userUri); - - RecommendStatus recommendMessage(int mid, int vuid); - - List listReactions(); - - RecommendStatus likeMessage(int mid, int vuid, int reactionId); - - RecommendStatus likeMessage(int mid, int vuid, int reactionId, String userUri); - - - boolean canViewThread(int mid, int uid); - - boolean isReadOnly(int mid); - - boolean isSubscribed(int uid, int mid); - - int getMessagePrivacy(int mid); - - com.juick.Message getMessage(int mid); - - com.juick.Message getReply(int mid, int rid); - - com.juick.Message getReplyByUri(String replyUri); - - User getMessageAuthor(int mid); - - List getMessageRecommendations(int mid); - - List getAll(int visitorUid, int before); - - List getTag(int tid, int visitorUid, int before, int cnt); - - List getTags(String tids, int visitorUid, int before, int cnt); - - List getPlace(int placeId, int visitorUid, int before); - - List getMyFeed(int uid, int before, boolean recommended); - - List getPrivate(int uid, int before); - - List getDiscussions(int uid, Long to); - - List getRecommended(int uid, int before); - - List getPopular(int visitorUid, int before); - - List getPhotos(int visitorUid, int before); - - List getSearch(User visitor, String search, int page); - - List getUserBlog(int uid, int privacy, int before); - - List getUserTag(int uid, int tid, int privacy, int before); - - List getUserBlogAtDay(int uid, int privacy, int daysback); - - List getUserBlogWithRecommendations(int uid, int privacy, int before); - - List getUserRecommendations(int uid, int before); - - List getUserPhotos(int uid, int privacy, int before); - - List getUserSearch(User visitor, int UID, String search, int privacy, int page); - - List getMessages(User visitor, List mids); - - Map> updateReactionsFor(final List mid); - - List getReplies(User user, int mid); - - boolean setMessagePopular(int mid, int popular); - - boolean setMessagePrivacy(int mid); - - boolean deleteMessage(int uid, int mid); - - boolean deleteReply(int uid, int mid, int rid); - - List getLastMessages(int hours); - - List getLastReplies(int hours); - - List getPopularCandidates(); - - void setLastReadComment(User user, Integer mid, Integer rid); - - void setRead(User user, Integer mid); - - List getUnread(User user); - - boolean updateMessage(Integer mid, Integer rid, String body); - - boolean updateReplyUri(Message reply, URI replyUri); - - boolean replyExists(URI replyUri); - - boolean deleteReply(URI userUri, URI replyUri); -} diff --git a/juick-common/src/main/java/com/juick/service/MessengerService.java b/juick-common/src/main/java/com/juick/service/MessengerService.java deleted file mode 100644 index e07c73fe..00000000 --- a/juick-common/src/main/java/com/juick/service/MessengerService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.juick.service; - -import com.juick.User; - -import java.util.Optional; - -public interface MessengerService { - Integer getUserId(String senderId); - Optional getSenderId(User user); - boolean createMessengerUser(String senderId, String displayName); - String getDisplayName(String hash); - String getSignUpHash(String senderId, String username); - boolean linkMessengerUser(String hash, int uid); -} diff --git a/juick-common/src/main/java/com/juick/service/PMQueriesService.java b/juick-common/src/main/java/com/juick/service/PMQueriesService.java deleted file mode 100644 index e0067544..00000000 --- a/juick-common/src/main/java/com/juick/service/PMQueriesService.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2008-2017, Juick - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package com.juick.service; - -import com.juick.Chat; -import com.juick.User; - -import java.util.List; - -/** - * Created by aalexeev on 11/13/16. - */ -public interface PMQueriesService { - boolean createPM(int uidFrom, int uid_to, String body); - - boolean addPMinRoster(int uid, String jid); - - boolean removePMinRoster(int uid, String jid); - - boolean havePMinRoster(int uid, String jid); - - List getLastChats(User user); - - List getPMMessages(int uid, int uidTo); - - List getLastPMInbox(int uid); - - List getLastPMSent(int uid); -} diff --git a/juick-common/src/main/java/com/juick/service/PrivacyQueriesService.java b/juick-common/src/main/java/com/juick/service/PrivacyQueriesService.java deleted file mode 100644 index 17dd6a9b..00000000 --- a/juick-common/src/main/java/com/juick/service/PrivacyQueriesService.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2008-2017, Juick - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package com.juick.service; - -import com.juick.Tag; -import com.juick.User; - -/** - * Created by aalexeev on 11/13/16. - */ -public interface PrivacyQueriesService { - enum PrivacyResult { - Removed, Added - } - - PrivacyResult blacklistUser(User user, User target); - - PrivacyResult blacklistTag(User user, Tag tag); -} diff --git a/juick-common/src/main/java/com/juick/service/PushQueriesService.java b/juick-common/src/main/java/com/juick/service/PushQueriesService.java deleted file mode 100644 index f84a83e4..00000000 --- a/juick-common/src/main/java/com/juick/service/PushQueriesService.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2008-2017, Juick - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package com.juick.service; - -import java.util.Collection; -import java.util.List; - -/** - * Created by aalexeev on 11/13/16. - */ -public interface PushQueriesService { - List getGCMRegID(int uid); - - List getGCMTokens(Collection uids); - - boolean addGCMToken(Integer uid, String token); - - boolean deleteGCMToken(String token); - - List getMPNSURL(int uid); - - List getMPNSTokens(Collection uids); - - boolean addMPNSToken(Integer uid, String token); - - boolean deleteMPNSToken(String token); - - List getAPNSToken(int uid); - - List getAPNSTokens(Collection uids); - - boolean addAPNSToken(Integer uid, String token); - - boolean deleteAPNSToken(String token); -} diff --git a/juick-common/src/main/java/com/juick/service/SearchService.java b/juick-common/src/main/java/com/juick/service/SearchService.java deleted file mode 100644 index 0dae5cfc..00000000 --- a/juick-common/src/main/java/com/juick/service/SearchService.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2008-2017, Juick - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package com.juick.service; - -import com.juick.User; - -import java.util.List; - -/** - * Created by aalexeev on 11/18/16. - */ -public interface SearchService { - void setMaxResult(int maxResult); - - List searchInAllMessages(User visitor, String searchString, int messageIdBefore); - - List searchByStringAndUser(User visitor, String searchString, final int userId, int messageIdBefore); -} diff --git a/juick-common/src/main/java/com/juick/service/ShowQueriesService.java b/juick-common/src/main/java/com/juick/service/ShowQueriesService.java deleted file mode 100644 index 32b34b4e..00000000 --- a/juick-common/src/main/java/com/juick/service/ShowQueriesService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2008-2017, Juick - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package com.juick.service; - -import com.juick.User; - -import java.util.List; - -/** - * Created by aalexeev on 11/13/16. - */ -public interface ShowQueriesService { - List getRecommendedUsers(User forUser); - - List getTopUsers(); -} diff --git a/juick-common/src/main/java/com/juick/service/SocialService.java b/juick-common/src/main/java/com/juick/service/SocialService.java deleted file mode 100644 index eb77619b..00000000 --- a/juick-common/src/main/java/com/juick/service/SocialService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.juick.service; - -import com.juick.User; - -import javax.annotation.Nonnull; -import java.util.List; - -public interface SocialService { - @Nonnull - User getUserByAccountUri(String acct); - @Nonnull - List getFollowers(User user); - void addFollower(User user, String acct); - void removeFollower(User user, String acct); - void removeAccount(String acct); -} diff --git a/juick-common/src/main/java/com/juick/service/SubscriptionService.java b/juick-common/src/main/java/com/juick/service/SubscriptionService.java deleted file mode 100644 index 8bc8d071..00000000 --- a/juick-common/src/main/java/com/juick/service/SubscriptionService.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2008-2017, Juick - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package com.juick.service; - -import com.juick.Message; -import com.juick.Tag; -import com.juick.User; -import com.juick.model.NotifyOpts; - -import java.util.List; - -/** - * Created by aalexeev on 11/13/16. - */ -public interface SubscriptionService { - - List getSubscribedUsers(int uid, Message msg); - - List getUsersSubscribedToComments(Message msg, Message reply); - - List getUsersSubscribedToComments(Message msg, Message reply, boolean blacklisted); - - List getUsersSubscribedToUserRecommendations(int uid, Message msg); - - boolean subscribeMessage(Message message, User user); - - boolean unSubscribeMessage(int mid, int vuid); - - boolean subscribeUser(User user, User toUser); - - boolean unSubscribeUser(User user, User fromUser); - - boolean subscribeTag(User user, Tag toTag); - - boolean unSubscribeTag(User user, Tag toTag); - - List getSubscribedTags(User user); - - NotifyOpts getNotifyOptions(User user); - - boolean setNotifyOptions(User user, NotifyOpts options); -} diff --git a/juick-common/src/main/java/com/juick/service/TagService.java b/juick-common/src/main/java/com/juick/service/TagService.java deleted file mode 100644 index 489f405a..00000000 --- a/juick-common/src/main/java/com/juick/service/TagService.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2008-2017, Juick - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package com.juick.service; - -import com.juick.Tag; -import com.juick.User; -import com.juick.model.TagStats; -import org.apache.commons.lang3.tuple.Pair; - -import java.util.Collection; -import java.util.List; -import java.util.stream.Stream; - -/** - * Created by aalexeev on 11/13/16. - */ -public interface TagService { - Tag getTag(int tid); - - Tag getTag(String tag, boolean autoCreate); - - List getTags(Stream tags, boolean autoCreate); - - boolean getTagNoIndex(int tagId); - - int createTag(String name); - - List getUserTagStats(int uid); - - List getUserBLTags(int uid); - - List getPopularTags(); - - List getTagStats(); - - List updateTags(int mid, Collection newTags); - - Pair> fromString(String txt); - - List getMessageTags(int mid); - - List getMessageTagsIDs(int mid); - - boolean blacklistTag(User user, Tag tag); - - boolean isInBL(User user, Tag tag); - - boolean isSubscribed(User user, Tag tag); -} diff --git a/juick-common/src/main/java/com/juick/service/TelegramService.java b/juick-common/src/main/java/com/juick/service/TelegramService.java deleted file mode 100644 index 2954370c..00000000 --- a/juick-common/src/main/java/com/juick/service/TelegramService.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2008-2017, Juick - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package com.juick.service; - -import com.juick.User; - -import java.util.List; - -/** - * Created by vt on 24/11/2016. - */ -public interface TelegramService { - - boolean deleteAnonymous(Long id); - - List getAnonymous(); - - int getUser(long tgId); - - boolean createTelegramUser(long tgID, String tgName); - - boolean deleteTelegramUser(Integer uid); - - List getTelegramIdentifiers(List users); -} diff --git a/juick-common/src/main/java/com/juick/service/UserService.java b/juick-common/src/main/java/com/juick/service/UserService.java deleted file mode 100644 index 832f978a..00000000 --- a/juick-common/src/main/java/com/juick/service/UserService.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (C) 2008-2017, Juick - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package com.juick.service; - -import com.juick.Message; -import com.juick.User; -import com.juick.model.Auth; -import com.juick.model.UserInfo; - -import javax.annotation.Nonnull; -import java.time.Instant; -import java.util.Collection; -import java.util.List; -import java.util.Optional; - -/** - * Created by aalexeev on 11/13/16. - */ -public interface UserService { - enum ActiveStatus { - Inactive, - Active - } - - String getSignUpHashByJID(String jid); - - String getSignUpHashByTelegramID(Long telegramId, String username); - - int createUser(String username, String password); - - Optional getUserByUID(int uid); - - @Nonnull User getUserByName(String username); - - @Nonnull User getUserByEmail(String email); - - User getUserByJID(String jid); - - List getUsersByName(Collection unames); - - List getUsersByID(Collection uids); - - List getJIDsbyUID(int uid); - - int getUIDbyJID(String jid); - - int getUIDbyName(String uname); - - int getUIDbyHash(String hash); - - @Nonnull com.juick.User getUserByHash(String hash); - - String getHashByUID(int uid); - - int checkPassword(String username, String password); - - boolean updatePassword(User user, String newPassword); - - int getUserOptionInt(int uid, String option, int defaultValue); - - int setUserOptionInt(int uid, String option, int value); - - UserInfo getUserInfo(User user); - - boolean updateUserInfo(User user, UserInfo info); - - boolean getCanMedia(int uid); - - boolean isInWL(int uid, int check); - - boolean isInBL(int uid, int check); - - boolean isInBLAny(int uid, int uid2); - - boolean isReplyToBL(final User user, final Message reply); - - List checkBL(int visitor, Collection uids); - - boolean isSubscribed(int uid, int check); - - List getUserReadLeastPopular(int uid, int cnt); - - List getUserReaders(int uid); - - List getUserFriends(int uid); - - Integer getUserRecommendations(User user); - - List getUserBLUsers(int uid); - - boolean linkTwitterAccount(User user, String accessToken, String accessTokenSecret, String screenName); - - int getStatsMyReaders(int uid); - - int getStatsMessages(int uid); - - int getStatsReplies(int uid); - - boolean setActiveStatusForJID(String JID, ActiveStatus jidStatus); - - List getAllJIDs(User user); - - List getAuthCodes(User user); - - List getEmails(User user); - - String getEmailHash(User user); - - int deleteLoginForUser(String name); - - int setLoginForUser(int uid, String loginHash); - - void logout(int uid); - - boolean deleteJID(int uid, String jid); - - boolean unauthJID(int uid, String jid); - - List getActiveJIDs(); - - void updateLastSeen(User user); -} diff --git a/juick-common/src/main/java/com/juick/service/component/DisconnectedEvent.java b/juick-common/src/main/java/com/juick/service/component/DisconnectedEvent.java deleted file mode 100644 index 552c3e66..00000000 --- a/juick-common/src/main/java/com/juick/service/component/DisconnectedEvent.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.juick.service.component; - -import org.springframework.context.ApplicationEvent; - -public class DisconnectedEvent extends ApplicationEvent { - /** - * Create a new ApplicationEvent. - * - * @param source the object on which the event initially occurred (never {@code null}) - */ - public DisconnectedEvent(Object source) { - super(source); - } -} diff --git a/juick-common/src/main/java/com/juick/service/component/LikeEvent.java b/juick-common/src/main/java/com/juick/service/component/LikeEvent.java deleted file mode 100644 index 0d4df70c..00000000 --- a/juick-common/src/main/java/com/juick/service/component/LikeEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.juick.service.component; - -import com.juick.Message; -import com.juick.User; -import org.springframework.context.ApplicationEvent; - -import java.util.List; - -public class LikeEvent extends ApplicationEvent { - private User user; - private Message message; - private List subscribers; - /** - * Create a new ApplicationEvent. - * - * @param source the object on which the event initially occurred (never {@code null}) - */ - public LikeEvent(Object source, User user, Message message, List subscribers) { - super(source); - this.message = message; - this.user = user; - this.subscribers = subscribers; - } - - public User getUser() { - return user; - } - - public Message getMessage() { - return message; - } - - public List getSubscribers() { - return subscribers; - } -} diff --git a/juick-common/src/main/java/com/juick/service/component/MessageEvent.java b/juick-common/src/main/java/com/juick/service/component/MessageEvent.java deleted file mode 100644 index 82911a58..00000000 --- a/juick-common/src/main/java/com/juick/service/component/MessageEvent.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.juick.service.component; - -import com.juick.Message; -import com.juick.User; -import org.springframework.context.ApplicationEvent; - -import java.util.List; - -public class MessageEvent extends ApplicationEvent { - private Message message; - private List users; - /** - * Create a new ApplicationEvent. - * - * @param source the object on which the event initially occurred (never {@code null}) - * @param message app message - * @param interestedUsers users interested in notification - */ - public MessageEvent(Object source, Message message, List interestedUsers) { - super(source); - this.message = message; - this.users = interestedUsers; - } - - public Message getMessage() { - return message; - } - public List getUsers() { - return users; - } -} diff --git a/juick-common/src/main/java/com/juick/service/component/MessageReadEvent.java b/juick-common/src/main/java/com/juick/service/component/MessageReadEvent.java deleted file mode 100644 index b070c8cb..00000000 --- a/juick-common/src/main/java/com/juick/service/component/MessageReadEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.juick.service.component; - -import com.juick.Message; -import com.juick.User; -import org.springframework.context.ApplicationEvent; - -import java.util.List; - -public class MessageReadEvent extends ApplicationEvent { - private User user; - private Message message; - /** - * Create a new ApplicationEvent. - * - * @param source the object on which the event initially occurred (never {@code null}) - */ - public MessageReadEvent(Object source, User user, Message message) { - super(source); - this.user = user; - this.message = message; - } - - public User getUser() { - return user; - } - - public Message getMessage() { - return message; - } -} diff --git a/juick-common/src/main/java/com/juick/service/component/NotificationListener.java b/juick-common/src/main/java/com/juick/service/component/NotificationListener.java deleted file mode 100644 index 38d0490a..00000000 --- a/juick-common/src/main/java/com/juick/service/component/NotificationListener.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.juick.service.component; - -import org.springframework.context.event.EventListener; -import org.springframework.scheduling.annotation.Async; - -public interface NotificationListener { - @Async - @EventListener - void processMessageEvent(MessageEvent messageEvent); - @Async - @EventListener - void processSubscribeEvent(SubscribeEvent subscribeEvent); - @Async - @EventListener - void processLikeEvent(LikeEvent likeEvent); - @Async - @EventListener - void processPingEvent(PingEvent pingEvent); - @Async - @EventListener - void processMessageReadEvent(MessageReadEvent messageReadEvent); - @Async - @EventListener - void processTopEvent(TopEvent topEvent); -} diff --git a/juick-common/src/main/java/com/juick/service/component/PingEvent.java b/juick-common/src/main/java/com/juick/service/component/PingEvent.java deleted file mode 100644 index 8e3f3fa7..00000000 --- a/juick-common/src/main/java/com/juick/service/component/PingEvent.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.juick.service.component; - -import com.juick.User; -import org.springframework.context.ApplicationEvent; - -public class PingEvent extends ApplicationEvent { - private User pinger; - /** - * Create a new ApplicationEvent. - * - * @param source the object on which the event initially occurred (never {@code null}) - */ - public PingEvent(Object source, User pinger) { - super(source); - this.pinger = pinger; - } - - public User getPinger() { - return pinger; - } -} diff --git a/juick-common/src/main/java/com/juick/service/component/SubscribeEvent.java b/juick-common/src/main/java/com/juick/service/component/SubscribeEvent.java deleted file mode 100644 index 9b644f2f..00000000 --- a/juick-common/src/main/java/com/juick/service/component/SubscribeEvent.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.juick.service.component; - -import com.juick.User; -import org.springframework.context.ApplicationEvent; - -public class SubscribeEvent extends ApplicationEvent { - private User user; - private User toUser; - /** - * Create a new ApplicationEvent. - * - * @param source the object on which the event initially occurred (never {@code null}) - */ - public SubscribeEvent(Object source, User user, User toUser) { - super(source); - this.user = user; - this.toUser = toUser; - } - - public User getUser() { - return user; - } - - public User getToUser() { - return toUser; - } -} diff --git a/juick-common/src/main/java/com/juick/service/component/TopEvent.java b/juick-common/src/main/java/com/juick/service/component/TopEvent.java deleted file mode 100644 index b7e24957..00000000 --- a/juick-common/src/main/java/com/juick/service/component/TopEvent.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.juick.service.component; - -import com.juick.Message; -import org.springframework.context.ApplicationEvent; - -public class TopEvent extends ApplicationEvent { - private Message message; - /** - * Create a new ApplicationEvent. - * - * @param source the object on which the event initially occurred (never {@code null}) - */ - public TopEvent(Object source, Message message) { - super(source); - this.message = message; - } - - public Message getMessage() { - return message; - } -} diff --git a/juick-common/src/main/java/com/juick/service/component/UserUpdatedEvent.java b/juick-common/src/main/java/com/juick/service/component/UserUpdatedEvent.java deleted file mode 100644 index af2f579a..00000000 --- a/juick-common/src/main/java/com/juick/service/component/UserUpdatedEvent.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.juick.service.component; - -import com.juick.User; -import org.springframework.context.ApplicationEvent; -import org.springframework.lang.NonNull; - -public class UserUpdatedEvent extends ApplicationEvent { - private User user; - /** - * Generated when user is updated (avatar changed, etc). - * - * @param source the object on which the event initially occurred (never {@code null}) - * @param user updated user - */ - public UserUpdatedEvent(@NonNull Object source, User user) { - super(source); - this.user = user; - } - - public User getUser() { - return user; - } -} -- cgit v1.2.3