diff options
author | 2019-12-12 11:28:12 +0300 | |
---|---|---|
committer | 2019-12-12 11:28:12 +0300 | |
commit | f462d7335567960978e16c5e042c99b54daa94b6 (patch) | |
tree | f298f3ac50ed64d0292bba0a8a6e148e8daa434c /src/main/java/com/juick/server/api/Post.java | |
parent | c0ae480bb5c07ea7b9e1b42df428e2857b0d4816 (diff) |
Cleanup IDEA code issues
Diffstat (limited to 'src/main/java/com/juick/server/api/Post.java')
-rw-r--r-- | src/main/java/com/juick/server/api/Post.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/main/java/com/juick/server/api/Post.java b/src/main/java/com/juick/server/api/Post.java index 59bd05a7..255b7290 100644 --- a/src/main/java/com/juick/server/api/Post.java +++ b/src/main/java/com/juick/server/api/Post.java @@ -28,7 +28,6 @@ import com.juick.server.util.HttpForbiddenException; import com.juick.server.util.HttpNotFoundException; import com.juick.server.util.HttpUtils; import com.juick.service.MessagesService; -import com.juick.service.SubscriptionService; import com.juick.service.UserService; import com.juick.service.security.annotation.Visitor; import org.apache.commons.lang3.StringUtils; @@ -58,12 +57,8 @@ public class Post { private UserService userService; @Inject private MessagesService messagesService; - @Inject - private SubscriptionService subscriptionService; @Value("${upload_tmp_dir:#{systemEnvironment['TEMP'] ?: '/tmp'}}") private String tmpDir; - @Value("${img_path:#{systemEnvironment['TEMP'] ?: '/tmp'}}") - private String imgDir; @Inject CommandsManager commandsManager; @@ -155,7 +150,7 @@ public class Post { @ResponseStatus(value = HttpStatus.OK) public Status doPostRecomm(@Visitor User visitor, @RequestParam Integer mid) throws Exception { Optional<com.juick.Message> message = messagesService.getMessage(mid); - if (!message.isPresent()) { + if (message.isEmpty()) { throw new HttpNotFoundException(); } Message msg = message.get(); @@ -172,7 +167,7 @@ public class Post { public Status doPostSubscribe(@Visitor User visitor, @RequestParam Integer mid) throws Exception { Optional<com.juick.Message> message = messagesService.getMessage(mid); - if (!message.isPresent()) { + if (message.isEmpty()) { throw new HttpNotFoundException(); } Message msg = message.get(); @@ -199,7 +194,7 @@ public class Post { logger.info("got reaction with type: {}", reactionId); Optional<com.juick.Message> message = messagesService.getMessage(mid); - if (!message.isPresent()) { + if (message.isEmpty()) { throw new HttpNotFoundException(); } Message msg = message.get(); |