package cn.ey.biz.module.system.framework.elasticsearch.config;

import cn.ey.biz.module.system.service.user.AdminUserServiceDBImpl;
import cn.ey.biz.module.system.service.user.AdminUserServiceESImpl;
import cn.ey.biz.module.system.service.user.AdminUserSuperService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ElasticSearchConfiguration {

    @Bean
    @ConditionalOnProperty(prefix = "ey.system", value = "db.enabled", havingValue = "true")
    public AdminUserSuperService adminUserSuperServiceDB(){
        return new AdminUserServiceDBImpl();
    }

    @Bean
    @ConditionalOnProperty(prefix = "ey.system", value = "es.enabled", havingValue = "true")
    public AdminUserSuperService adminUserSuperServiceES(){
        return new AdminUserServiceESImpl();
    }


}
