/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved. <a>http://www.crunii.com</a>
 */
package com.crunii.micro.ds.config;

import com.crunii.micro.common.constants.DSConstants;
import com.crunii.micro.ds.single.druid.MainDSDmConfiguration;
import com.crunii.micro.ds.single.druid.MainDSMysqlConfiguration;
import com.crunii.micro.ds.single.druid.MainDSPostgresqlConfiguration;
import com.crunii.micro.platform.jdbc.log.BusiLogJdbcDao;
import com.crunii.micro.platform.jdbc.log.CallLogJdbcDao;
import com.crunii.micro.platform.jdbc.log.OperLogJdbcDao;
import com.crunii.micro.platform.jdbc.log.SqlLogJdbcDao;
import com.crunii.micro.platform.service.BusiLogService;
import com.crunii.micro.platform.service.CallLogService;
import com.crunii.micro.platform.service.OperLogService;
import com.crunii.micro.platform.service.SqlLogService;
import com.crunii.micro.platform.service.impl.BusiLogServiceImpl;
import com.crunii.micro.platform.service.impl.CallLogServiceImpl;
import com.crunii.micro.platform.service.impl.OperLogServiceImpl;
import com.crunii.micro.platform.service.impl.SqlLogServiceImpl;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 田平 create 2019年12月4日下午5:03:05
 */
@Configuration
@AutoConfigureAfter({
		MainDSPostgresqlConfiguration.class,
		MainDSMysqlConfiguration.class,
		MainDSDmConfiguration.class
})
@ConditionalOnBean(name = DSConstants.DB_MAIN + "DS")
public class LogPersistentConfiguration {

	@Bean
	public BusiLogJdbcDao regBusiLogJdbcDao() {
		return new BusiLogJdbcDao();
	}

	@Bean
	public BusiLogService regBusiLogService() {
		return new BusiLogServiceImpl();
	}

	@Bean
	public CallLogJdbcDao regCallLogJdbcDao() {
		return new CallLogJdbcDao();
	}

	@Bean
	public CallLogService regCallLogService() {
		return new CallLogServiceImpl();
	}

	@Bean
	public OperLogJdbcDao regOperLogJdbcDao() {
		return new OperLogJdbcDao();
	}

	@Bean
	public OperLogService regOperLogService() {
		return new OperLogServiceImpl();
	}

	@Bean
	public SqlLogJdbcDao regSqlLogJdbcDao() {
		return new SqlLogJdbcDao();
	}

	@Bean
	public SqlLogService regSqlLogService() {
		return new SqlLogServiceImpl();
	}

}
