保誠-保戶業務員媒合平台
Jack
2021-12-22 6c645d811f0c81eca814d56fa651e9088ce6fc13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package com.pollex.pam.security;
 
import com.pollex.pam.config.Constants;
import java.util.Optional;
import org.springframework.data.domain.AuditorAware;
import org.springframework.stereotype.Component;
 
/**
 * Implementation of {@link AuditorAware} based on Spring Security.
 */
@Component
public class SpringSecurityAuditorAware implements AuditorAware<String> {
 
    @Override
    public Optional<String> getCurrentAuditor() {
        return Optional.of(SecurityUtils.getCurrentUserLogin().orElse(Constants.SYSTEM));
    }
}