aboutsummaryrefslogtreecommitdiff
path: root/juick-common/src/main/java/com/juick/server/configuration/StorageConfiguration.java
blob: 4101f37db3ed9c5fc0ed044311a99ade3f7e0a75 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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(imgDir, tmpDir);
    }
}