diff options
author | Vitaly Takmazov | 2022-12-31 01:32:42 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2022-12-31 01:32:42 +0300 |
commit | bf5550b515c305c017cf8b3fcf04976d74314233 (patch) | |
tree | 7da644034410ee138dc821a6f0f30194a2cd0859 /src/main/java/com/juick/service | |
parent | 47bdad85f7ac2b12daf1da4e340be902a568d976 (diff) |
PMQueriesService -> ChatService
Diffstat (limited to 'src/main/java/com/juick/service')
-rw-r--r-- | src/main/java/com/juick/service/ChatService.java (renamed from src/main/java/com/juick/service/PMQueriesService.java) | 12 | ||||
-rw-r--r-- | src/main/java/com/juick/service/ChatServiceImpl.java (renamed from src/main/java/com/juick/service/PMQueriesServiceImpl.java) | 10 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/main/java/com/juick/service/PMQueriesService.java b/src/main/java/com/juick/service/ChatService.java index bb57b7c3..b09e93b0 100644 --- a/src/main/java/com/juick/service/PMQueriesService.java +++ b/src/main/java/com/juick/service/ChatService.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2020, Juick + * Copyright (C) 2008-2022, 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 @@ -26,8 +26,8 @@ import java.util.List; /** * Created by aalexeev on 11/13/16. */ -public interface PMQueriesService { - boolean createPM(int uidFrom, int uid_to, String body); +public interface ChatService { + boolean createMessage(int uidFrom, int uid_to, String body); boolean addPMinRoster(int uid, String jid); @@ -37,9 +37,9 @@ public interface PMQueriesService { List<Chat> getLastChats(User user); - List<Message> getPMMessages(int uid, int uidTo); + List<Message> getChat(int uid, int uidTo); - List<Message> getLastPMInbox(int uid); + List<Message> getInbox(int uid); - List<Message> getLastPMSent(int uid); + List<Message> getOutbox(int uid); } diff --git a/src/main/java/com/juick/service/PMQueriesServiceImpl.java b/src/main/java/com/juick/service/ChatServiceImpl.java index c2e06da5..2d3fe31a 100644 --- a/src/main/java/com/juick/service/PMQueriesServiceImpl.java +++ b/src/main/java/com/juick/service/ChatServiceImpl.java @@ -31,11 +31,11 @@ import java.util.List; * Created by aalexeev on 11/13/16. */ @Repository -public class PMQueriesServiceImpl extends BaseJdbcService implements PMQueriesService { +public class ChatServiceImpl extends BaseJdbcService implements ChatService { @Transactional @Override - public boolean createPM(final int uidFrom, final int uid_to, final String body) { + public boolean createMessage(final int uidFrom, final int uid_to, final String body) { return getJdbcTemplate().update( "INSERT INTO pm(user_id, user_id_to, txt) VALUES (?, ?, ?)", uidFrom, uid_to, body) > 0; @@ -89,7 +89,7 @@ public class PMQueriesServiceImpl extends BaseJdbcService implements PMQueriesSe @Transactional @Override - public List<Message> getPMMessages(final int uid, final int uidTo) { + public List<Message> getChat(final int uid, final int uidTo) { SqlParameterSource sqlParameterSource = new MapSqlParameterSource() .addValue("uid", uid) .addValue("uidTo", uidTo); @@ -113,7 +113,7 @@ public class PMQueriesServiceImpl extends BaseJdbcService implements PMQueriesSe @Transactional(readOnly = true) @Override - public List<Message> getLastPMInbox(final int uid) { + public List<Message> getInbox(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", @@ -131,7 +131,7 @@ public class PMQueriesServiceImpl extends BaseJdbcService implements PMQueriesSe @Transactional(readOnly = true) @Override - public List<Message> getLastPMSent(final int uid) { + public List<Message> getOutbox(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 " + |