|
@@ -6,7 +6,6 @@ import java.util.Map;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeansException;
|
|
|
import org.springframework.beans.factory.InitializingBean;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
import org.springframework.context.ApplicationContextAware;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -17,9 +16,6 @@ import com.ym.mec.thirdparty.user.realname.provider.LinkfaceRealnameAuthenticati
|
|
|
@Component
|
|
|
public class RealnameAuthenticationPluginContext implements ApplicationContextAware, InitializingBean {
|
|
|
|
|
|
- @Value("${thirdparty.realnameAuthenticationPluginName:linkface}")
|
|
|
- private String pluginName;
|
|
|
-
|
|
|
private ApplicationContext applicationContext;
|
|
|
|
|
|
private final Map<String, String> mapper = new HashMap<String, String>() {
|
|
@@ -34,19 +30,9 @@ public class RealnameAuthenticationPluginContext implements ApplicationContextAw
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- private RealnameAuthenticationPlugin realnameAuthenticationPlugin;
|
|
|
-
|
|
|
@Override
|
|
|
public void afterPropertiesSet() throws Exception {
|
|
|
- if (StringUtils.isBlank(pluginName)) {
|
|
|
- throw new ThirdpartyException("存储插件变量thirdparty.storagePlugName不能为空");
|
|
|
- }
|
|
|
|
|
|
- realnameAuthenticationPlugin = getStoragePlugin(pluginName);
|
|
|
-
|
|
|
- if (realnameAuthenticationPlugin == null) {
|
|
|
- throw new ThirdpartyException("实名认证插件{}不存在", pluginName);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -54,7 +40,8 @@ public class RealnameAuthenticationPluginContext implements ApplicationContextAw
|
|
|
this.applicationContext = applicationContext;
|
|
|
}
|
|
|
|
|
|
- private RealnameAuthenticationPlugin getStoragePlugin(String vendors) {
|
|
|
+ public RealnameAuthenticationPlugin getRealnameAuthenticationPlugin(String vendors) {
|
|
|
+
|
|
|
String beanId = mapper.get(vendors);
|
|
|
|
|
|
if (StringUtils.isBlank(beanId)) {
|