diff options
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/controllers')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/controllers/Post.java | 7 | ||||
-rw-r--r-- | juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java | 8 |
2 files changed, 8 insertions, 7 deletions
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Post.java b/juick-api/src/main/java/com/juick/api/controllers/Post.java index 18f417d8..0fbf87e8 100644 --- a/juick-api/src/main/java/com/juick/api/controllers/Post.java +++ b/juick-api/src/main/java/com/juick/api/controllers/Post.java @@ -99,7 +99,7 @@ public class Post { } String attachmentFName = HttpUtils.receiveMultiPartFile(attach, env.getProperty("upload_tmp_dir", - "/var/www/juick.com/i/tmp/")); + "/var/www/juick.com/i/tmp/")); if (StringUtils.isBlank(attachmentFName) && img != null && img.length() > 10) { try { @@ -142,7 +142,7 @@ public class Post { OobX xoob = new OobX(new URI(attachmentURL)); xmsg.addExtension(xoob); } catch (URISyntaxException e) { - logger.error("invalid uri: " + attachmentURL, e); + logger.error("invalid uri: {}, exception {}", attachmentURL, e); } } @@ -173,6 +173,7 @@ public class Post { } return jmsg; } + @RequestMapping(value = "/comment", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public com.juick.Message doPostComment( Principal principal, @@ -263,7 +264,7 @@ public class Post { try { xmsg.addExtension(new OobX(new URI(attachmentURL))); } catch (URISyntaxException e) { - logger.error("invalid uri: " + attachmentURL, e); + logger.error("invalid uri: {}, exception {}", attachmentURL, e); } } diff --git a/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java b/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java index 8b491167..60856ec6 100644 --- a/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java +++ b/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java @@ -38,13 +38,13 @@ public class TelegramWebhook { if (update.message() == null) { message = update.editedMessage(); if (message == null) { - logger.error("error parsing telegram update: " + update.toString()); + logger.error("error parsing telegram update: {}", update); return; } } - logger.info(String.format("got telegram msg %s", message.toString())); + logger.info("got telegram msg {}", message); User user_from = usersService.getUserByUID(telegramService.getUser(message.chat().id())).orElse(new User()); - logger.info(String.format("Found juick user %d", user_from.getUid())); + logger.info("Found juick user {}", user_from.getUid()); List<Long> chats = telegramService.getChats(); String username = message.from().username(); @@ -53,7 +53,7 @@ public class TelegramWebhook { } if (!chats.contains(message.chat().id())) { telegramService.addChat(message.chat().id()); - logger.info("added chat with " + username); + logger.info("added chat with {}", username); telegramService.createTelegramUser(message.from().id(), username); tgBot.telegramSignupNotify(message.from().id().longValue(), usersService.getSignUpHashByTelegramID(message.from().id().longValue(), username)); } else { |