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 --- .../java/com/juick/server/configuration/StorageConfiguration.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'juick-common/src/main/java/com/juick/server/configuration') diff --git a/juick-common/src/main/java/com/juick/server/configuration/StorageConfiguration.java b/juick-common/src/main/java/com/juick/server/configuration/StorageConfiguration.java index 94b23037..4101f37d 100644 --- a/juick-common/src/main/java/com/juick/server/configuration/StorageConfiguration.java +++ b/juick-common/src/main/java/com/juick/server/configuration/StorageConfiguration.java @@ -2,13 +2,19 @@ package com.juick.server.configuration; import com.juick.service.ImagesService; import com.juick.service.ImagesServiceImpl; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class StorageConfiguration { + + @Value("${upload_tmp_dir:#{systemEnvironment['TEMP'] ?: '/tmp'}}") + private String tmpDir; + @Value("${img_path:#{systemEnvironment['TEMP'] ?: '/tmp'}}") + private String imgDir; @Bean public ImagesService imagesService() { - return new ImagesServiceImpl(); + return new ImagesServiceImpl(imgDir, tmpDir); } } -- cgit v1.2.3