chore: audit log first

This commit is contained in:
xiaojunnuo
2026-07-10 19:24:42 +08:00
parent edda1b57f3
commit 4250d0e266
33 changed files with 1396 additions and 77 deletions
@@ -127,4 +127,18 @@ export abstract class BaseController {
}
return { projectId, userId };
}
async auditLog(bean: { type: string; action: string; content: string; projectId?: number; projectName?: string }) {
const auditService: any = await this.applicationContext.getAsync("auditService");
await auditService.log({
userId: this.getUserId(),
type: bean.type,
action: bean.action,
content: bean.content,
username: this.ctx.user?.username,
projectId: bean.projectId,
projectName: bean.projectName,
ipAddress: this.ctx.ip,
});
}
}