feat(ci,ai): P2-1 权限注册表 + P2-2 AI utoipa 注解全覆盖

P2-1 权限注册表单一真相源:
- 新增 permissions.yaml: 131 个权限码 × 8 模块,含冻结标记
- 新增 scripts/gen-permissions.js: 生成器脚本
  --sql 输出 seed SQL, --frontend 输出 routeConfig 片段,
  --validate 验证一致性(131/131 = 0 mismatches)

P2-2 AI 模块 utoipa 注解:
- 为 30 个 handler 函数添加 #[utoipa::path] 注解
  (mod.rs 18 + insight 3 + risk 1 + rule 4 + suggestion 4)
- 为 6 个 DTO struct 添加 ToSchema/IntoParams derive
  (AnalyzeBody, CreatePromptBody, CreateRuleBody, UpdateRuleBody,
   ApproveBody, ExecuteBody, DialysisLabInput, ListAnalysisQuery,
   ListPromptsQuery)
- AI handler utoipa 覆盖率: 0/5 → 5/5 (100%)
This commit is contained in:
iven
2026-05-13 17:45:45 +08:00
parent 20d606d21c
commit 02082ccc61
11 changed files with 1500 additions and 9 deletions

View File

@@ -27,7 +27,7 @@ pub enum RiskLevel {
Critical,
}
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, utoipa::ToSchema)]
pub struct CreateRuleBody {
pub name: String,
pub category: String,
@@ -39,7 +39,7 @@ pub struct CreateRuleBody {
pub sort_order: Option<i32>,
}
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, utoipa::ToSchema)]
pub struct UpdateRuleBody {
pub name: Option<String>,
pub category: Option<String>,