chore: 批量修改流水线优化

This commit is contained in:
xiaojunnuo
2025-12-16 22:31:06 +08:00
parent c5a3003cf7
commit 3e2f2fc02e
2 changed files with 44 additions and 10 deletions
@@ -142,26 +142,36 @@ export class PipelineController extends CrudController<PipelineService> {
@Post('/batchDelete', { summary: Constants.per.authOnly })
async batchDelete(@Body('ids') ids: number[]) {
await this.service.batchDelete(ids, this.getUserId());
const isAdmin = await this.authService.isAdmin(this.ctx);
const userId = isAdmin ? undefined : this.getUserId() ;
await this.service.batchDelete(ids, userId);
return this.ok({});
}
@Post('/batchUpdateGroup', { summary: Constants.per.authOnly })
async batchUpdateGroup(@Body('ids') ids: number[], @Body('groupId') groupId: number) {
await this.service.batchUpdateGroup(ids, groupId, this.getUserId());
const isAdmin = await this.authService.isAdmin(this.ctx);
const userId = isAdmin ? undefined : this.getUserId() ;
await this.service.batchUpdateGroup(ids, groupId, userId);
return this.ok({});
}
@Post('/batchUpdateTrigger', { summary: Constants.per.authOnly })
async batchUpdateTrigger(@Body('ids') ids: number[], @Body('trigger') trigger: any) {
await this.service.batchUpdateTrigger(ids, trigger, this.getUserId());
const isAdmin = await this.authService.isAdmin(this.ctx);
const userId = isAdmin ? undefined : this.getUserId() ;
await this.service.batchUpdateTrigger(ids, trigger, userId);
return this.ok({});
}
@Post('/batchUpdateNotification', { summary: Constants.per.authOnly })
async batchUpdateNotification(@Body('ids') ids: number[], @Body('notification') notification: any) {
await this.service.batchUpdateNotifications(ids, notification, this.getUserId());
const isAdmin = await this.authService.isAdmin(this.ctx);
const userId = isAdmin ? undefined : this.getUserId() ;
await this.service.batchUpdateNotifications(ids, notification, userId);
return this.ok({});
}