保誠-保戶業務員媒合平台
wayne
2022-03-11 242fad1691917c4fd82c7f04b6190a7113628e93
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.pollex.pam.security;
 
import com.pollex.pam.business.config.Constants;
import java.util.Optional;
 
import com.pollex.pam.business.security.SecurityUtils;
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));
    }
}