aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/service
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-12-12 11:28:12 +0300
committerGravatar Vitaly Takmazov2019-12-12 11:28:12 +0300
commitf462d7335567960978e16c5e042c99b54daa94b6 (patch)
treef298f3ac50ed64d0292bba0a8a6e148e8daa434c /src/main/java/com/juick/service
parentc0ae480bb5c07ea7b9e1b42df428e2857b0d4816 (diff)
Cleanup IDEA code issues
Diffstat (limited to 'src/main/java/com/juick/service')
-rw-r--r--src/main/java/com/juick/service/EmailServiceImpl.java2
-rw-r--r--src/main/java/com/juick/service/ImagesServiceImpl.java3
-rw-r--r--src/main/java/com/juick/service/MessagesServiceImpl.java5
-rw-r--r--src/main/java/com/juick/service/PushQueriesServiceImpl.java2
-rw-r--r--src/main/java/com/juick/service/SubscriptionServiceImpl.java1
-rw-r--r--src/main/java/com/juick/service/UserService.java1
-rw-r--r--src/main/java/com/juick/service/activities/AnnounceEvent.java4
-rw-r--r--src/main/java/com/juick/service/component/SystemEvent.java4
8 files changed, 4 insertions, 18 deletions
diff --git a/src/main/java/com/juick/service/EmailServiceImpl.java b/src/main/java/com/juick/service/EmailServiceImpl.java
index 78bdd42a..d5375ead 100644
--- a/src/main/java/com/juick/service/EmailServiceImpl.java
+++ b/src/main/java/com/juick/service/EmailServiceImpl.java
@@ -19,12 +19,10 @@ package com.juick.service;
import org.apache.commons.lang3.StringUtils;
import org.springframework.dao.EmptyResultDataAccessException;
-import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
-import javax.inject.Inject;
import java.util.List;
/**
diff --git a/src/main/java/com/juick/service/ImagesServiceImpl.java b/src/main/java/com/juick/service/ImagesServiceImpl.java
index 67c8360e..f91b6036 100644
--- a/src/main/java/com/juick/service/ImagesServiceImpl.java
+++ b/src/main/java/com/juick/service/ImagesServiceImpl.java
@@ -13,10 +13,9 @@ import java.nio.file.Paths;
public class ImagesServiceImpl implements ImagesService {
private ImageUtils imageUtils;
private String imgDir;
- private String tmpDir;
+
public ImagesServiceImpl(String imgDir, String tmpDir) {
this.imgDir = imgDir;
- this.tmpDir = tmpDir;
imageUtils = new ImageUtils(imgDir, tmpDir);
}
@Override
diff --git a/src/main/java/com/juick/service/MessagesServiceImpl.java b/src/main/java/com/juick/service/MessagesServiceImpl.java
index 8bcf47d3..c405fde4 100644
--- a/src/main/java/com/juick/service/MessagesServiceImpl.java
+++ b/src/main/java/com/juick/service/MessagesServiceImpl.java
@@ -23,7 +23,6 @@ import com.juick.User;
import com.juick.model.AnonymousUser;
import com.juick.model.PrivacyOpts;
import com.juick.model.ResponseReply;
-import com.juick.server.util.HttpNotFoundException;
import com.juick.server.www.WebApp;
import com.juick.util.MessageUtils;
import org.apache.commons.collections4.CollectionUtils;
@@ -601,7 +600,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
.addValue("uid", uid)
.addValue("before", before);
- List<Integer> mids = getNamedParameterJdbcTemplate().queryForList(
+ return getNamedParameterJdbcTemplate().queryForList(
"SELECT message_id FROM messages WHERE " +
"(user_id=:uid OR " +
"(EXISTS (SELECT 1 FROM subscr_users WHERE subscr_users.suser_id = :uid " +
@@ -624,8 +623,6 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
"ORDER BY message_id DESC LIMIT 20",
sqlParameterSource,
Integer.class);
-
- return mids;
}
@Transactional(readOnly = true)
diff --git a/src/main/java/com/juick/service/PushQueriesServiceImpl.java b/src/main/java/com/juick/service/PushQueriesServiceImpl.java
index 7f97956c..9b1ee2f0 100644
--- a/src/main/java/com/juick/service/PushQueriesServiceImpl.java
+++ b/src/main/java/com/juick/service/PushQueriesServiceImpl.java
@@ -19,12 +19,10 @@ package com.juick.service;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.dao.DuplicateKeyException;
-import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
-import javax.inject.Inject;
import java.util.Collection;
import java.util.Collections;
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 5ce3593b..50f87699 100644
--- a/src/main/java/com/juick/service/SubscriptionServiceImpl.java
+++ b/src/main/java/com/juick/service/SubscriptionServiceImpl.java
@@ -25,7 +25,6 @@ import com.juick.util.MessageUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.IteratorUtils;
import org.apache.commons.collections4.ListUtils;
-import org.apache.commons.lang3.StringUtils;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.stereotype.Repository;
diff --git a/src/main/java/com/juick/service/UserService.java b/src/main/java/com/juick/service/UserService.java
index 0d4efcfc..16afe08f 100644
--- a/src/main/java/com/juick/service/UserService.java
+++ b/src/main/java/com/juick/service/UserService.java
@@ -22,7 +22,6 @@ import com.juick.User;
import com.juick.model.Auth;
import javax.annotation.Nonnull;
-import java.time.Instant;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
diff --git a/src/main/java/com/juick/service/activities/AnnounceEvent.java b/src/main/java/com/juick/service/activities/AnnounceEvent.java
index 00dbea8c..7fb2be22 100644
--- a/src/main/java/com/juick/service/activities/AnnounceEvent.java
+++ b/src/main/java/com/juick/service/activities/AnnounceEvent.java
@@ -3,8 +3,8 @@ package com.juick.service.activities;
import org.springframework.context.ApplicationEvent;
public class AnnounceEvent extends ApplicationEvent {
- private String actorUri;
- private String messageUri;
+ private final String actorUri;
+ private final String messageUri;
public AnnounceEvent(Object source, String actor, String messageUri) {
super(source);
diff --git a/src/main/java/com/juick/service/component/SystemEvent.java b/src/main/java/com/juick/service/component/SystemEvent.java
index 11a10860..f5852ba4 100644
--- a/src/main/java/com/juick/service/component/SystemEvent.java
+++ b/src/main/java/com/juick/service/component/SystemEvent.java
@@ -1,12 +1,8 @@
package com.juick.service.component;
-import com.juick.Message;
-import com.juick.User;
import com.juick.server.api.SystemActivity;
import org.springframework.context.ApplicationEvent;
-import java.util.List;
-
public class SystemEvent extends ApplicationEvent {
private SystemActivity activity;
/**