孔祥富
2021-03-01 1c7cb9c300fda246db57ef5c43d118c7eaef22d6
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
package cc.mrbird.febs.server.hr.runner;
 
import cc.mrbird.febs.common.core.utils.FebsUtil;
import cc.mrbird.febs.server.hr.properties.FebsServerHrProperties;
import cn.hutool.core.io.FileUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
 
/**
 * @author MrBird
 */
@Component
@RequiredArgsConstructor
public class StartedUpRunner implements ApplicationRunner {
 
    private final ConfigurableApplicationContext context;
    private final Environment environment;
    private final FebsServerHrProperties properties;
    @Override
    public void run(ApplicationArguments args) {
        if (context.isActive()) {
            FebsUtil.printSystemUpBanner(environment);
        }
      if (! FileUtil.exist(  properties.getEmpBaseInfoPath())){
          FileUtil.mkdir( properties.getEmpBaseInfoPath());
        }
    }
}