Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

从数据库读取商户信息时,yaml中不配置会报错 #88

Closed
wenguangji opened this issue Feb 3, 2023 · 2 comments
Closed

从数据库读取商户信息时,yaml中不配置会报错 #88

wenguangji opened this issue Feb 3, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@wenguangji
Copy link

D5J7 GOKD4T(@6QQ~ V73
从数据库读取商户信息,删除yaml中全部商户的配置时报错

@NotFound403
Copy link
Collaborator

NotFound403 commented Feb 3, 2023

以下功能会在1.0.16版本后实装

  public interface WechatTenantService {
    Set<WechatMetaBean> getAllTenants();
  }

实现上述接口并注入Spring IoC 即可达到从其它数据源加载配置的目的,例如:

@Configuration(proxyBeanMethods = false)
public class DataSourceWechatTenantServiceConfiguration {

    // DataSourceWechatTenantService是WechatTenantService的实现
    @Bean
    public WechatTenantService wechatTenantService(WechatDataSourceService datasource) {
        return new DataSourceWechatTenantService(datasource);
    }
}

@NotFound403 NotFound403 self-assigned this Feb 3, 2023
@NotFound403 NotFound403 added the enhancement New feature or request label Feb 3, 2023
@NotFound403 NotFound403 mentioned this issue Feb 10, 2023
@NotFound403 NotFound403 changed the title 从数据库读取商户信息时,yaml中至少保留一个商户配置 从数据库读取商户信息时,yaml中不配置会报错 Mar 6, 2023
@NotFound403
Copy link
Collaborator

刷新参考 spring applicationcontext 的刷新机制 用 holder来 getBean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants