wuyouming666
2024-02-28 d765f491fe415a218975892c6f4651c13764e1f3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.mes.config;
 
import com.mes.service.Plcaction;
import com.mes.service.DownGlassInfoService;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;
 
@Component
class AppStartup implements ApplicationListener<ContextRefreshedEvent> {
 
    private final DownGlassInfoService downGlassInfoService;
 
    public AppStartup(DownGlassInfoService downGlassInfoService) {
        this.downGlassInfoService = downGlassInfoService;
    }
 
    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        Plcaction.setDownGlassInfoService(downGlassInfoService);
        new Plcaction().start();
    }
}