|
|
|
@ -150,7 +150,7 @@ public class ModelIndexServiceImpl extends ServiceImpl<ModelIndexMapper, ModelIn
|
|
|
|
|
if (StringUtils.equals("2", modelAtomicIndex.getIndexSource())){
|
|
|
|
|
// 如果查询类型为数据查询,则校验查询语句
|
|
|
|
|
Assert.notEmpty(modelAtomicIndex.getQueryLang(), "查询语言不能为空");
|
|
|
|
|
Assert.isFalse(checkSql(modelAtomicIndex.getQueryLang()), "查询语句不合法");
|
|
|
|
|
Assert.isTrue(checkSql(modelAtomicIndex.getQueryLang()), "查询语句不合法");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isEmpty(modelAtomicIndex.getId())) {
|
|
|
|
|
i = modelAtomicIndexService.getMapper().insert(modelAtomicIndex);
|
|
|
|
@ -262,6 +262,7 @@ public class ModelIndexServiceImpl extends ServiceImpl<ModelIndexMapper, ModelIn
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean checkSql(String sql) {
|
|
|
|
|
log.info("checkSql:{}", sql);
|
|
|
|
|
if (StringUtils.isEmpty(sql)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|