package com.supervision.rasa; import com.supervision.config.WebConfig; import com.supervision.rasa.service.RasaModelManager; import com.supervision.rasa.service.Text2vecService; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.FilterType; import org.springframework.scheduling.annotation.EnableScheduling; @SpringBootApplication @EnableScheduling @MapperScan(basePackages = {"com.supervision.**.mapper"}) // 排除JWT权限校验 @ComponentScan(basePackages = {"com.supervision"},excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {WebConfig.class})) public class VirtualPatientRasaApplication { public static void main(String[] args) { ConfigurableApplicationContext context = SpringApplication.run(VirtualPatientRasaApplication.class, args); // 启动rasa服务 RasaModelManager rasaModelManager = context.getBean(RasaModelManager.class); try { rasaModelManager.wakeUpInterruptServerScheduled(); } catch (Exception e) { throw new RuntimeException(e); } // 初始化文本匹配数据 Text2vecService text2vecService = context.getBean(Text2vecService.class); text2vecService.initText2vecDataset(); } }