chenjiahe
2024-09-23 826b66207dafbce24f441cb83fed1b241a6fba27
提交 | 用户 | age
826b66 1 package com.hx.auto.manage.xml.scan;
C 2
3 import com.hx.auto.GeneratorUtil;
4 import com.hx.auto.manage.xml.scan.util.ConfigUtil;
5 import com.hx.auto.manage.xml.scan.util.CreateMapperUtil;
6 import org.springframework.beans.factory.annotation.Autowired;
7 import org.springframework.stereotype.Service;
8
9 import javax.annotation.PostConstruct;
10 import java.util.Set;
11
12 /**
13  * 启动时进行处理的实现类
14  * @author chenbin.sun
15  *
16  */
17 @SuppressWarnings("restriction")
18 @Service
19 public class StartScanXmlHandlerImpl implements StartScanXmlHandler {
20     
21     @Autowired
22     private ConfigUtil configUtil;
23
24     @PostConstruct
25     public void startHandler() throws Exception {
26         if(configUtil.getIsScan()){
27             System.out.println("开始扫描更新xml文件");
28             Set<Class<?>> classes = GeneratorUtil.classData(configUtil.getModelPack());
29             for(Class<?> cl:classes) {
30                 CreateMapperUtil.generatorMapper(cl,configUtil);
31             }
32         }
33     }
34 }