2025-12-10 19:12:54 +07:00
|
|
|
package ru.soune.nocopy.configuration;
|
2025-11-24 12:29:32 +07:00
|
|
|
|
2026-01-22 19:55:09 +07:00
|
|
|
import com.vrt.AudioFilePathProvider;
|
2026-01-13 13:28:09 +07:00
|
|
|
import com.vrt.fileprotection.FileProtector;
|
2026-01-22 19:55:09 +07:00
|
|
|
import com.vrt.fileprotection.audio.AudioLocalSearch;
|
2026-02-10 18:38:46 +07:00
|
|
|
import com.vrt.fileprotection.documents.DocumentLocalSearch;
|
2026-01-22 19:55:09 +07:00
|
|
|
import com.vrt.fileprotection.image.ImageLocalSearch;
|
|
|
|
|
import com.vrt.fileprotection.image.ImageUniqueCheck;
|
2026-01-08 03:22:32 +07:00
|
|
|
import lombok.AllArgsConstructor;
|
2025-11-24 12:29:32 +07:00
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
|
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
|
|
|
|
|
2026-01-08 03:22:32 +07:00
|
|
|
import java.util.Collections;
|
|
|
|
|
|
2025-11-24 12:29:32 +07:00
|
|
|
@Configuration
|
|
|
|
|
@EnableAutoConfiguration
|
2026-01-08 03:22:32 +07:00
|
|
|
@AllArgsConstructor
|
2025-11-24 12:29:32 +07:00
|
|
|
public class ApplicationConfig {
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
PasswordEncoder passwordEncoder() {
|
|
|
|
|
return new BCryptPasswordEncoder();
|
|
|
|
|
}
|
2026-01-08 03:22:32 +07:00
|
|
|
|
|
|
|
|
@Bean
|
2026-01-22 19:55:09 +07:00
|
|
|
public com.vrt.
|
|
|
|
|
NoCopyFileService noCopyFileService(
|
2026-01-13 13:28:09 +07:00
|
|
|
FileProtector.FileProvider fileProvider,
|
2026-01-22 19:55:09 +07:00
|
|
|
FileProtector.ProcessingListener processingListener,
|
|
|
|
|
ImageUniqueCheck imageUniqueCheck,
|
|
|
|
|
ImageLocalSearch imageLocalSearch,
|
|
|
|
|
AudioLocalSearch audioLocalSearch,
|
2026-02-10 18:38:46 +07:00
|
|
|
AudioFilePathProvider audioFilePathProvider,
|
|
|
|
|
DocumentLocalSearch documentLocalSearch) {
|
2026-01-08 03:22:32 +07:00
|
|
|
|
2026-01-13 13:28:09 +07:00
|
|
|
return new com.vrt.NoCopyFileService(
|
|
|
|
|
Collections.emptyList(),
|
|
|
|
|
fileProvider,
|
2026-01-22 19:55:09 +07:00
|
|
|
processingListener,
|
|
|
|
|
imageUniqueCheck,
|
|
|
|
|
imageLocalSearch,
|
|
|
|
|
audioLocalSearch,
|
2026-02-10 18:38:46 +07:00
|
|
|
audioFilePathProvider,
|
|
|
|
|
documentLocalSearch
|
2026-01-13 13:28:09 +07:00
|
|
|
);
|
2026-01-08 03:22:32 +07:00
|
|
|
}
|
2025-11-24 12:29:32 +07:00
|
|
|
}
|
2026-01-13 13:28:09 +07:00
|
|
|
|