springboot 里main函数启动批量程序,一般跑批或定时器就用这种简单的main函数即可
@EnableTransactionManagement
@SpringBootApplication
@MapperScan(basePackages={"com.test.dao"})
public class Tmain implements CommandLineRunner{
Logger logger=LogManager.getLogger(Tmain.class);
@Resource
private TestService testService
public static void main(String[] args) throws Exception{
SpringApplication.run(Tmain.class,args);
}
@Override
public void run(String args){
logger.info("开始你的逻辑");
}
}