package org.nl.start; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.modules.wql.WQLCore; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; /** * 随项目启动模块 */ @Slf4j @Component @RequiredArgsConstructor @Order(0) public class Init implements ApplicationRunner { private void init() throws Exception { //初始化WQL initWql(); System.out.println("项目启动成功!"); } private void initWql() throws Exception { WQLCore.ROOT = "org.nl"; WQLCore.init(); log.info("WQL初始化成功!"); } @Override public void run(ApplicationArguments args) throws Exception { this.init(); } }