基于中科视拓的seetaface6封装的免费人脸识别项目后端接口
shentao
2025-09-22 4e24fd913e7b048436aa7e5001cf875baac81ff5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.code2roc.fastface.config;
 
import com.code2roc.fastface.db.MapperBeanManage;
import com.code2roc.fastface.util.DataBaseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
 
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
 
@Component
public class StartUpContext  implements ApplicationRunner {
    @Autowired
    private ApplicationContext context;
    @Autowired
    private MapperBeanManage mapperBeanManage;
    @Autowired
    private DataBaseUtil dataBaseUtil;
 
 
    @Override
    public void run(ApplicationArguments args) throws Exception {
        Map<String, Object> annotatedBeans = context.getBeansWithAnnotation(SpringBootApplication.class);
        List<Class> bootClassList = new ArrayList<>();
        for (String key:annotatedBeans.keySet()) {
            bootClassList.add(annotatedBeans.get(key).getClass());
        }
        mapperBeanManage.initMapperBean(bootClassList);
        dataBaseUtil.init();
    }
}