返回数据优化

parent aed82397
......@@ -97,14 +97,14 @@ public class ChromosomeDataController {
// 文件实体必须要有sceneId
if (isFileEntity(entityName) && (sceneId == null || sceneId.isEmpty())) {
return R.ok(null);
return ok(Collections.emptyList());
}
// 直接调用服务层的list查询方法
List<Object> result = chromosomeDataService.queryChromosomeDataList(sceneId, entityName, paged);
if (result == null) {
return ok(Collections.emptyList(), "查询成功,但未找到匹配的数据");
return ok(Collections.emptyList());
}
return ok(result);
......@@ -289,4 +289,4 @@ public class ChromosomeDataController {
Map<String, Object> results = chromosomeDataService.executeSqlOrderCommit(sqlOrders);
return ok(results);
}
}
\ No newline at end of file
}
......@@ -1755,6 +1755,10 @@ public class ChromosomeDataService {
// 检查是否是直接传入的EntityConfig(这种情况可能需要获取场景ID和实体类型)
// 实际上这个方法是在queryChromosomeDataList中调用的,此时数据已经从文件中获取
if (data == null) {
return new ArrayList<>();
}
if (data instanceof List) {
List<Object> dataList = (List<Object>) data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment