All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edi.rule.config.JSRuleAutoConfiguration Maven / Gradle / Ivy

The newest version!
package edi.rule.config;

import edi.rule.extend.classes.JSRuleDefaultExtend;
import edi.rule.util.ZSReflect;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.*;
import edi.rule.extend.classes.abstracts.JSRuleDBFields;
import edi.rule.extend.classes.abstracts.JSRuleDBFunctions;
import edi.rule.model.JSResult;
import edi.rule.work.constant.JSRuleSystem;

/**
 * @author 摩拉克斯
 * @date 2022年2月23日 下午3:00:37
 */

@Configuration
@Import({JSRuleContext.class})
@ComponentScan(value= {JSRuleSystem.SCANNER_LOCATION},excludeFilters= {@ComponentScan.Filter(type=FilterType.ANNOTATION,value=Mapper.class)})
public class JSRuleAutoConfiguration {

	@Bean
	@ConditionalOnMissingBean(JSRuleDefaultExtend.class)
	public JSRuleDefaultExtend defaultJSRuleProcessor() throws ClassNotFoundException {
		return ZSReflect.createObject(Class.forName(JSRuleContext.getProperties().processor));
	}
	
	@Bean
	@ConditionalOnMissingBean(JSResult.class)
	public JSResult defaultJSRuleResult() {
		return JSResult.instance();
	}
	
	@Bean
	@ConditionalOnMissingBean(JSRuleDBFunctions.class)
	public JSRuleDBFunctions defaultJSRuleDBFunctions() {
		return ZSReflect.createObject(JSRuleContext.getDbInfo().getFunction());
	}
	
	@Bean
	@ConditionalOnMissingBean(JSRuleDBFields.class)
	public JSRuleDBFields defaultJSRuleDBFields() {
		return ZSReflect.createObject(JSRuleContext.getDbInfo().getField());
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy