27 lines
717 B
Java
Executable File
27 lines
717 B
Java
Executable File
package io.gmss.fiscad.configuration;
|
|
|
|
|
|
import io.gmss.fiscad.repositories.user.UserRepository;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.data.domain.AuditorAware;
|
|
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
|
|
|
@Configuration
|
|
@EnableJpaAuditing(auditorAwareRef = "auditorProvider")
|
|
public class AuditConfig {
|
|
|
|
private final UserRepository userRepository;
|
|
|
|
public AuditConfig(UserRepository userRepository) {
|
|
this.userRepository = userRepository;
|
|
}
|
|
|
|
|
|
@Bean
|
|
public AuditorAware<Long> auditorProvider() {
|
|
return new AuditorAwareImpl(userRepository);
|
|
}
|
|
|
|
}
|