feat(knowledge): add scoped activity audit trail

This commit is contained in:
wizardchen
2026-07-22 19:15:27 +08:00
committed by lyingbug
parent f195e0494c
commit a3a0308b62
44 changed files with 2429 additions and 81 deletions
@@ -68,6 +68,15 @@ func (r *auditLogRepository) List(
if q.ActorUserID != "" {
tx = tx.Where("actor_user_id = ?", q.ActorUserID)
}
if q.ScopeType != "" {
tx = tx.Where("scope_type = ?", q.ScopeType)
}
if q.ScopeID != "" {
tx = tx.Where("scope_id = ?", q.ScopeID)
}
if q.UnscopedOnly {
tx = tx.Where("scope_type = ''")
}
}
var entries []*types.AuditLog