ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的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; } ```