企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## 一、概述 非静态的特别简单,不用多说了; ## 二、方案 ### **方案1** ``` @Component public class ApiFacade { private static CardSourceDao CardSourceDao; private static CardSourceThirdPartyDao CardSourceThirdPartyDao; @Autowired public void setComponent(CardSourceDao CardSourceDao, CardSourceThirdPartyDao CardSourceThirdPartyDao) { ApiFacade.CardSourceDao = CardSourceDao; ApiFacade.CardSourceThirdPartyDao = CardSourceThirdPartyDao; } ``` ### **方案2** ``` @Autowired private GlobalProperties globalProperties; private static GlobalProperties properties = null; @PostConstruct public void init() { properties = globalProperties; } ```