package com.hx.auto.manage.xml.scan;
|
|
import com.hx.auto.GeneratorUtil;
|
import com.hx.auto.manage.xml.scan.util.ConfigUtil;
|
import com.hx.auto.manage.xml.scan.util.CreateMapperUtil;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.PostConstruct;
|
import java.util.Set;
|
|
/**
|
* 启动时进行处理的实现类
|
* @author chenbin.sun
|
*
|
*/
|
@SuppressWarnings("restriction")
|
@Service
|
public class StartScanXmlHandlerImpl implements StartScanXmlHandler {
|
|
@Autowired
|
private ConfigUtil configUtil;
|
|
@PostConstruct
|
public void startHandler() throws Exception {
|
if(configUtil.getIsScan()){
|
System.out.println("开始扫描更新xml文件");
|
Set<Class<?>> classes = GeneratorUtil.classData(configUtil.getModelPack());
|
for(Class<?> cl:classes) {
|
CreateMapperUtil.generatorMapper(cl,configUtil);
|
}
|
}
|
}
|
}
|