import { Router } from 'express';
import { AuditController } from '../controllers/AuditController';
import { requireTraceContext } from '../../core/guards/trace-context.guard';
import { requirePermission } from '../../core/guards/rbac.guard';

const router = Router();

router.get('/timeline', requireTraceContext, AuditController.getTimeline);
router.get('/risk-profile', requireTraceContext, AuditController.getRiskProfile);

/**
 * [BIZ_AUDIT_11] 红蓝对抗
 */
router.post('/red-teaming/run', requireTraceContext, requirePermission('audit:write'), AuditController.runRedTeaming);

/**
 * [CORE_LOG_05] NL-Audit
 */
router.post('/nl-query', requireTraceContext, requirePermission('audit:read'), AuditController.queryNLAudit);

/**
 * [CORE_TELE_08] API 成本账单
 */
router.get('/cost-bill', requireTraceContext, requirePermission('finance:read'), AuditController.getCostBill);

/**
 * [CORE_TELE_09] 分布式追踪拓扑
 */
router.get('/telemetry/topo', requireTraceContext, requirePermission('audit:read'), AuditController.getTracingTopo);

export default router;
