冷热数据分离需要单独开启,平台开启,还需要特定服务开启
parent
27609b8e2c
commit
da94dad971
@ -0,0 +1,38 @@
|
|||||||
|
package cn.estsh.i3plus.core.apiservice.configuration;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.core.api.iservice.base.ICoreDataSourceService;
|
||||||
|
import cn.estsh.i3plus.core.api.iservice.base.IDataSeparatorService;
|
||||||
|
import cn.estsh.impp.framework.boot.init.IAppStartSystemInit;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2022/1/17 16:03
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
@ConditionalOnExpression("'${impp.aspect.data.separation:false}' == 'true'")
|
||||||
|
public class DataSeparatorSystemInit implements IAppStartSystemInit {
|
||||||
|
@Autowired
|
||||||
|
private IDataSeparatorService dataSeparatorService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ICoreDataSourceService iCoreDataSourceService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void systemInit() {
|
||||||
|
log.info("【通用数据冷热分离初始化开始...】");
|
||||||
|
dataSeparatorService.separatorRedisInit();
|
||||||
|
log.info("【通用数据冷热分离初始化结束...】");
|
||||||
|
|
||||||
|
log.info("【通用数据冷热分离初始化数据源开始...】");
|
||||||
|
iCoreDataSourceService.initCoreDataSource();
|
||||||
|
log.info("【通用数据冷热分离初始化数据源结束...】");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue