chore: 继续完善审计日志

This commit is contained in:
xiaojunnuo
2026-07-13 00:53:19 +08:00
parent bfb3ee4c43
commit 947fe729cb
59 changed files with 420 additions and 581 deletions
@@ -26,7 +26,7 @@ export class AddonController extends CrudController<AddonService> {
}
getAuditType(): string {
return AuditType.addon;
return AuditType.addon.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询Addon分页列表" })
@@ -22,7 +22,7 @@ export class GroupController extends CrudController<GroupService> {
}
getAuditType(): string {
return AuditType.pipelineGroup;
return AuditType.pipelineGroup.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询分组分页列表" })
@@ -16,7 +16,7 @@ export class CertApplyTemplateController extends CrudController<CertApplyTemplat
}
getAuditType(): string {
return AuditType.certTemplate;
return AuditType.certTemplate.value;
}
private removeContent(data: any) {
@@ -59,7 +59,7 @@ export class CertApplyTemplateController extends CrudController<CertApplyTemplat
bean.projectId = projectId;
bean.userId = userId;
const res = await super.add(bean);
this.auditLog({ content: `新增了证书参数模版(ID:${res.data})` });
this.auditLog({ content: `新增了证书参数模版${bean.name}(ID:${res.data})` });
return res;
}
@@ -69,7 +69,7 @@ export class CertApplyTemplateController extends CrudController<CertApplyTemplat
delete bean.userId;
delete bean.projectId;
const res = await super.update(bean);
this.auditLog({ content: `修改了证书参数模版(ID:${bean.id})` });
this.auditLog({ content: `修改了证书参数模版${bean.name}(ID:${bean.id})` });
return res;
}
@@ -16,7 +16,7 @@ export class DnsPersistRecordController extends CrudController<DnsPersistRecordS
}
getAuditType(): string {
return AuditType.dnsPersist;
return AuditType.dnsPersist.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询DNS持久验证记录分页列表" })
@@ -34,7 +34,7 @@ export class DnsPersistRecordController extends CrudController<DnsPersistRecordS
bean.projectId = projectId;
bean.userId = userId;
const res = await this.getService().add(bean);
this.auditLog({ content: `新增了DNS持久验证记录(ID:${res.id})` });
this.auditLog({ content: `新增了DNS持久验证记录${bean.domain}(ID:${res.id})` });
return this.ok(res);
}
@@ -21,7 +21,7 @@ export class DomainController extends CrudController<DomainService> {
}
getAuditType(): string {
return AuditType.domain;
return AuditType.domain.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询域名分页列表" })
@@ -19,7 +19,7 @@ export class CnameRecordController extends CrudController<CnameRecordService> {
}
getAuditType(): string {
return AuditType.cname;
return AuditType.cname.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询CNAME记录分页列表" })
@@ -26,7 +26,7 @@ export class UserProjectController extends BaseController {
}
getAuditType(): string {
return AuditType.enterprise;
return AuditType.enterprise.value;
}
/**
@@ -26,7 +26,7 @@ export class ProjectMemberController extends CrudController<ProjectMemberEntity>
}
getAuditType(): string {
return AuditType.enterprise;
return AuditType.enterprise.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询项目成员分页列表" })
@@ -18,7 +18,7 @@ export class TransferController extends BaseController {
}
getAuditType(): string {
return AuditType.enterprise;
return AuditType.enterprise.value;
}
/**
@@ -15,7 +15,7 @@ export class EmailController extends BaseController {
emailService: EmailService;
getAuditType(): string {
return AuditType.mine;
return AuditType.mine.value;
}
@Post("/test", { description: Constants.per.authOnly, summary: "测试邮件发送" })
@@ -43,7 +43,7 @@ export class MineController extends BaseController {
emailService: EmailService;
getAuditType(): string {
return AuditType.mine;
return AuditType.mine.value;
}
@Inject()
taskServiceBuilder: TaskServiceBuilder;
@@ -16,7 +16,7 @@ export class MinePasskeyController extends BaseController {
userService: UserService;
getAuditType(): string {
return AuditType.mine;
return AuditType.mine.value;
}
@Post("/generateRegistration", { description: Constants.per.authOnly, summary: "生成Passkey注册选项" })
@@ -21,7 +21,7 @@ export class UserTwoFactorSettingController extends BaseController {
twoFactorService: TwoFactorService;
getAuditType(): string {
return AuditType.mine;
return AuditType.mine.value;
}
@Post("/get", { description: Constants.per.authOnly, summary: "获取双因子认证设置" })
@@ -22,7 +22,7 @@ export class UserSettingsController extends CrudController<UserSettingsService>
}
getAuditType(): string {
return AuditType.mine;
return AuditType.mine.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询用户设置分页列表" })
@@ -31,7 +31,7 @@ export class CertInfoController extends CrudController<CertInfoService> {
}
getAuditType(): string {
return AuditType.monitor;
return AuditType.monitor.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询证书分页列表" })
@@ -123,7 +123,7 @@ export class CertInfoController extends CrudController<CertInfoService> {
bean.projectId = projectId;
bean.userId = userId;
const res = await super.add(bean);
this.auditLog({ content: `新增了证书(ID:${res.data})` });
this.auditLog({ content: `新增了证书${bean.domain}(ID:${res.data})` });
return res;
}
@@ -24,7 +24,7 @@ export class JobHistoryController extends CrudController<JobHistoryService> {
}
getAuditType(): string {
return AuditType.jobHistory;
return AuditType.jobHistory.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询监控运行历史分页列表" })
@@ -26,7 +26,7 @@ export class SiteInfoController extends CrudController<SiteInfoService> {
}
getAuditType(): string {
return AuditType.monitor;
return AuditType.monitor.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询站点监控分页列表" })
@@ -24,7 +24,7 @@ export class SiteInfoController extends CrudController<SiteIpService> {
}
getAuditType(): string {
return AuditType.siteIp;
return AuditType.siteIp.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询站点IP分页列表" })
@@ -62,7 +62,7 @@ export class SiteInfoController extends CrudController<SiteIpService> {
const { domain, httpsPort } = siteEntity;
this.service.check(res.id, domain, httpsPort);
}
this.auditLog({ content: `新增了站点IP(ID:${res.id})` });
this.auditLog({ content: `新增了站点IP${bean.ipAddress}(ID:${res.id})` });
return this.ok(res);
}
@@ -92,7 +92,7 @@ export class SiteInfoController extends CrudController<SiteIpService> {
const entity = await this.service.info(id);
const res = await super.delete(id);
await this.service.updateIpCount(entity.siteId);
this.auditLog({ content: `删除了站点IP(ID:${id})` });
this.auditLog({ content: `删除了站点IP${entity.ipAddress}(ID:${id})` });
return res;
}
@@ -20,7 +20,7 @@ export class OpenKeyController extends CrudController<OpenKeyService> {
}
getAuditType(): string {
return AuditType.openKey;
return AuditType.openKey.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询开放API密钥分页列表" })
@@ -22,7 +22,7 @@ export class AccessController extends CrudController<AccessService> {
}
getAuditType(): string {
return AuditType.access;
return AuditType.access.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询授权配置分页列表" })
@@ -23,7 +23,7 @@ export class NotificationController extends CrudController<NotificationService>
}
getAuditType(): string {
return AuditType.notification;
return AuditType.notification.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询通知配置分页列表" })
@@ -129,7 +129,7 @@ export class PipelineController extends CrudController<PipelineService> {
}
getAuditType(): string {
return AuditType.pipeline;
return AuditType.pipeline.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询流水线分页列表" })
@@ -22,7 +22,7 @@ export class PipelineGroupController extends CrudController<PipelineGroupService
}
getAuditType(): string {
return AuditType.pipelineGroup;
return AuditType.pipelineGroup.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询流水线分组分页列表" })
@@ -24,7 +24,7 @@ export class SubDomainController extends CrudController<SubDomainService> {
}
getAuditType(): string {
return AuditType.subDomain;
return AuditType.subDomain.value;
}
@Post("/parseDomain", { description: Constants.per.authOnly, summary: "解析域名" })
@@ -70,7 +70,7 @@ export class SubDomainController extends CrudController<SubDomainService> {
bean.userId = userId;
bean.projectId = projectId;
const res = await super.add(bean);
this.auditLog({ content: `新增了子域名(ID:${res.data})` });
this.auditLog({ content: `新增了子域名${bean.domain}(ID:${res.data})` });
return res;
}
@@ -20,7 +20,7 @@ export class TemplateController extends CrudController<TemplateService> {
}
getAuditType(): string {
return AuditType.template;
return AuditType.template.value;
}
@Post("/page", { description: Constants.per.authOnly, summary: "查询流水线模版分页列表" })
@@ -58,7 +58,7 @@ export class TemplateController extends CrudController<TemplateService> {
bean.projectId = projectId;
checkPlus();
const res = await super.add(bean);
this.auditLog({ content: `新增了流水线模版「${bean.name}」(ID:${res.data})` });
this.auditLog({ content: `新增了流水线模版「${bean.title}」(ID:${res.data})` });
return res;
}
@@ -68,7 +68,7 @@ export class TemplateController extends CrudController<TemplateService> {
delete bean.userId;
delete bean.projectId;
const res = await super.update(bean);
this.auditLog({ content: `修改了流水线模版「${bean.name}」(ID:${bean.id})` });
this.auditLog({ content: `修改了流水线模版「${bean.title}」(ID:${bean.id})` });
return res;
}
@Post("/info", { description: Constants.per.authOnly, summary: "查询流水线模版详情" })