From f7a2f1440ef0c13a472b1b815186615d2c54168a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 11 Apr 2018 14:05:43 +0300 Subject: server: ImagesService refactoring --- juick-www/src/main/java/com/juick/www/controllers/Settings.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'juick-www/src/main/java/com/juick/www/controllers/Settings.java') diff --git a/juick-www/src/main/java/com/juick/www/controllers/Settings.java b/juick-www/src/main/java/com/juick/www/controllers/Settings.java index 15f18052..3d381815 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/Settings.java +++ b/juick-www/src/main/java/com/juick/www/controllers/Settings.java @@ -76,6 +76,8 @@ public class Settings { private TelegramService telegramService; @Inject private ApplicationEventPublisher applicationEventPublisher; + @Inject + private ImagesService imagesService; @GetMapping("/settings") protected String doGet(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws IOException { @@ -160,7 +162,7 @@ public class Settings { info.setDescription(request.getParameter("descr")); String avatarTmpPath = HttpUtils.receiveMultiPartFile(avatar, tmpDir).getHost(); if (StringUtils.isNotEmpty(avatarTmpPath)) { - ImageUtils.saveAvatar(avatarTmpPath, visitor.getUid(), tmpDir, imgDir); + imagesService.saveAvatar(avatarTmpPath, visitor.getUid()); } if (userService.updateUserInfo(visitor, info)) { applicationEventPublisher.publishEvent(new UserUpdatedEvent(this, visitor)); -- cgit v1.2.3