增加启动一次的处理

This commit is contained in:
daihh
2022-10-19 17:52:56 +08:00
parent afbb1fb3f8
commit 6ab5fb2996

View File

@@ -0,0 +1,31 @@
package com.xboe;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import lombok.extern.slf4j.Slf4j;
/**
* 启动执行一次
* @author seastar
*
*/
@Slf4j
@Component
public class StartRunner implements ApplicationRunner {
@Override
public void run(ApplicationArguments args) throws Exception {
try {
//启动执行一次
} catch (Exception e) {
log.error("执行失败",e);
e.printStackTrace();
}
}
}