fix(数据源): 校验参数有效性

This commit is contained in:
taojinlong 2022-07-29 12:02:10 +08:00
parent a9f6d0ac98
commit 5030ced037

View File

@ -232,6 +232,10 @@ public class DatasourceService {
datasource.setCreateTime(null);
datasource.setType(updataDsRequest.getType());
datasource.setUpdateTime(System.currentTimeMillis());
Provider datasourceProvider = ProviderFactory.getProvider(updataDsRequest.getType());
datasourceProvider.checkConfiguration(datasource);
checkAndUpdateDatasourceStatus(datasource);
DatasourceExample example = new DatasourceExample();
example.createCriteria().andIdEqualTo(updataDsRequest.getId());
@ -255,6 +259,7 @@ public class DatasourceService {
BeanUtils.copyBean(datasourceDTO, datasource);
try {
Provider datasourceProvider = ProviderFactory.getProvider(datasource.getType());
datasourceProvider.checkConfiguration(datasource);
DatasourceRequest datasourceRequest = new DatasourceRequest();
datasourceRequest.setDatasource(datasource);
String datasourceStatus = datasourceProvider.checkStatus(datasourceRequest);