refactor: 统一userProject查询参数传递逻辑

This commit is contained in:
xiaojunnuo
2026-06-04 00:00:40 +08:00
parent cdb812ef63
commit 2cbacb4338
30 changed files with 158 additions and 134 deletions
@@ -84,10 +84,7 @@ export class DomainController extends CrudController<DomainService> {
@Post("/deleteByIds", { description: Constants.per.authOnly, summary: "批量删除域名" })
async deleteByIds(@Body(ALL) body: any) {
const { projectId, userId } = await this.getProjectUserIdRead();
await this.service.delete(body.ids, {
userId: userId,
projectId: projectId,
});
await this.service.batchDelete(body.ids, userId, projectId);
return this.ok();
}
@@ -82,10 +82,7 @@ export class CnameRecordController extends CrudController<CnameRecordService> {
@Post("/deleteByIds", { description: Constants.per.authOnly, summary: "批量删除CNAME记录" })
async deleteByIds(@Body(ALL) body: any) {
const { userId, projectId } = await this.getProjectUserIdWrite();
await this.service.delete(body.ids, {
userId,
projectId,
});
await this.service.batchDelete(body.ids, userId, projectId);
return this.ok();
}
@Post("/getByDomain", { description: Constants.per.authOnly, summary: "根据域名获取CNAME记录" })