package com.lideeyunji.tool.framework.operatelog.config;

import com.lideeyunji.tool.framework.operatelog.core.aop.OperateLogAspect;
import com.lideeyunji.tool.framework.operatelog.core.service.OperateLogFrameworkService;
import com.lideeyunji.tool.framework.operatelog.core.service.OperateLogFrameworkServiceImpl;
import com.lideeyunji.service.system.api.IApiOperateLogApi;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

@AutoConfiguration
@EnableConfigurationProperties(OperateLogProperties.class)
public class OperateLogAutoConfiguration {

    @Bean
    public OperateLogAspect operateLogAspect() {
        return new OperateLogAspect();
    }

    @Bean
    public OperateLogFrameworkService operateLogFrameworkService(IApiOperateLogApi apiOperateLogApi) {
        return new OperateLogFrameworkServiceImpl(apiOperateLogApi);
    }

}
