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

const router = Router();

/**
 * [BIZ_INT_12] 企业集成网关 - Webhook 配置 API
 */

// 获取配置 (需要管理权限)
router.get('/config', requireTraceContext, requirePermission('governance:read'), WebhookController.getConfig);

// 保存配置 (需要管理权限)
router.post('/config', requireTraceContext, requirePermission('governance:write'), WebhookController.saveConfig);

export default router;
