whycxzp
2021-07-09 489cc658a7f1a166058138bd4c57b6ce3e64ca72
src/main/java/com/whyc/Application.java
@@ -15,6 +15,8 @@
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import static java.lang.Thread.sleep;
/**
 * @Description : 启动类
 * @date 2020/10/15
@@ -30,6 +32,16 @@
        ApplicationContext applicationContext = SpringUtil.getApplicationContext();
        ClearTableService service = (ClearTableService) applicationContext.getBean("clearTableService");
        service.clearTable();
        service.dropTable();
        int sleepSeconds = 5;
        System.out.println("清除/删除操作完成,"+sleepSeconds+"秒后自动退出程序...");
        try {
            sleep(sleepSeconds*1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("程序终止");
        System.exit(1);
    }
}