feat: add audit and app log services
This commit is contained in:
@@ -198,11 +198,7 @@ func (s *AuthService) recordAudit(actor string, action string, targetType string
|
||||
if strings.TrimSpace(actor) == "" {
|
||||
actor = "anonymous"
|
||||
}
|
||||
_, err := s.store.DB.Exec(`
|
||||
INSERT INTO audit_logs (actor, action, target_type, target_id, detail, created_at)
|
||||
VALUES (?, ?, ?, ?, ?, ?)
|
||||
`, actor, action, targetType, targetID, detail, time.Now().UTC().Format(time.RFC3339))
|
||||
return err
|
||||
return recordAuditLog(s.store, actor, action, targetType, targetID, detail)
|
||||
}
|
||||
|
||||
func scanAuthSession(row *sql.Row) (models.AuthSession, error) {
|
||||
|
||||
Reference in New Issue
Block a user