/** * IIT 质控规则管理路由 */ import { FastifyInstance } from 'fastify'; import * as controller from './iitQcRuleController.js'; export async function iitQcRuleRoutes(fastify: FastifyInstance) { // 获取项目的所有质控规则 fastify.get('/:projectId/rules', controller.listRules); // 获取规则统计 fastify.get('/:projectId/rules/stats', controller.getRuleStats); // 获取单条规则 fastify.get('/:projectId/rules/:ruleId', controller.getRule); // 添加规则 fastify.post('/:projectId/rules', controller.addRule); // 更新规则 fastify.put('/:projectId/rules/:ruleId', controller.updateRule); // 删除规则 fastify.delete('/:projectId/rules/:ruleId', controller.deleteRule); // 批量导入规则 fastify.post('/:projectId/rules/import', controller.importRules); // AI 规则建议 fastify.post('/:projectId/rules/suggest', controller.suggestRules); // 测试规则逻辑(不需要项目 ID) fastify.post('/rules/test', controller.testRule); }