perf: 密钥备份

This commit is contained in:
xiaojunnuo
2024-10-15 12:59:40 +08:00
parent 28bb4856be
commit 1c6028abcf
12 changed files with 180 additions and 30 deletions
@@ -44,6 +44,9 @@ export class StorageService extends BaseService<StorageEntity> {
}
async findPipelineVars(pipelineIds: number[]) {
if (pipelineIds == null || pipelineIds.length === 0) {
throw new Error('pipelineIds 不能为空');
}
return await this.repository.find({
where: {
scope: 'pipeline',
@@ -52,4 +55,17 @@ export class StorageService extends BaseService<StorageEntity> {
},
});
}
async getPipelinePrivateVars(pipelineId: number) {
if (pipelineId == null) {
throw new Error('pipelineId 不能为空');
}
return await this.repository.find({
where: {
scope: 'pipeline',
namespace: pipelineId + '',
key: 'privateVars',
},
});
}
}