feat(audit): change audit log action to string at db level and split file/folder actions

This commit is contained in:
yiling
2026-08-01 14:49:08 +08:00
parent 6d80f06c22
commit 5ef7716c9c
19 changed files with 192 additions and 193 deletions
+12 -1
View File
@@ -9,7 +9,9 @@ import {
import { paginationParamsSchema } from '@shumai/dtos'
import { authzService, Permission, ResourceType } from '@shumai/core/src/authz/authz'
import { notificationService } from '@shumai/core/src/notification/notification'
import { NotificationType } from '@shumai/db'
import { auditLogService } from '@shumai/core/src/auditLog/auditLog'
import { assetService } from '@shumai/core/src/asset/asset'
import { NotificationType, AuditAction } from '@shumai/db'
import { s3Service, verifyLocalUrlSignature } from '@shumai/core/src/s3/s3'
import type { Prisma } from '@shumai/db'
@@ -108,6 +110,15 @@ const route = new Hono<{ Variables: { user: User } }>()
assetId: req.fileId,
taskId: taskId,
})
const context = await assetService.getAssetContext(req.fileId)
await auditLogService.logAction({
action: AuditAction.file_create,
teamId: teamId,
userId: user.id,
projectId: context.projectId,
itemId: req.fileId,
})
}
return c.json({ success: true })