perf: 优化流水线列表页面、详情页面性能,精简返回数据

This commit is contained in:
xiaojunnuo
2025-07-14 01:36:40 +08:00
parent 79f2367472
commit 609ac9c9a2
9 changed files with 93 additions and 50 deletions

View File

@@ -164,8 +164,11 @@ export abstract class BaseService<T> {
}
private buildListQuery(listReq: ListReq<T>) {
const { query, sort, buildQuery } = listReq;
const { query, sort, buildQuery,select } = listReq;
const qb = this.getRepository().createQueryBuilder('main');
if (select) {
qb.setFindOptions({select});
}
if (query) {
const keys = Object.keys(query);
for (const key of keys) {
@@ -191,6 +194,7 @@ export abstract class BaseService<T> {
if (buildQuery) {
buildQuery(qb);
}
return qb;
}