com.github.rexsheng.springboot.faster.system.config.SystemConfig Maven / Gradle / Ivy
The newest version!
package com.github.rexsheng.springboot.faster.system.config;
import com.github.rexsheng.springboot.faster.aop.EnableSpringAop;
import com.github.rexsheng.springboot.faster.io.MixPropertySourceFactory;
import com.github.rexsheng.springboot.faster.logging.RequestLogAutoConfiguration;
import com.github.rexsheng.springboot.faster.mail.configuration.JavaMailAutoConfiguration;
import com.github.rexsheng.springboot.faster.system.job.application.JobErrorMailLogger;
import com.github.rexsheng.springboot.faster.system.modular.AppModuleProperties;
import com.github.rexsheng.springboot.faster.system.modular.ModuleImportSelector;
import com.github.rexsheng.springboot.faster.system.mybatis.EntityFieldAutoFillRegisterBean;
import com.mybatisflex.annotation.Table;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.*;
@AutoConfiguration
@AutoConfigureBefore(RequestLogAutoConfiguration.class)
@AutoConfigureAfter({JavaMailAutoConfiguration.class})
@PropertySource(value = "classpath:system-config.yml",factory = MixPropertySourceFactory.class)
@Import({ModuleImportSelector.class,JobErrorMailLogger.class})
@MapperScan("com.github.rexsheng.springboot.faster.system.mapper")
@EnableConfigurationProperties(AppModuleProperties.class)
@EnableSpringAop
public class SystemConfig {
@Bean
@ConditionalOnClass(Table.class)
public EntityFieldAutoFillRegisterBean entityAutoFillRegisterBean(){
EntityFieldAutoFillRegisterBean register=new EntityFieldAutoFillRegisterBean();
// register.addEntity(User.class, a->a.autoCreateTime());
register.scanPackage("com.github.rexsheng.springboot.faster.system.entity", Table.class);
return register;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy