新增: 三实体列表查询维度补全(status/关键词/排序/分页下沉后端)

任务/项目/灵感三实体新增 list_by_query 动态 WHERE(累积式 where_clauses
+params_vec 收口)+ order_by 白名单防注入 + limit/offset 钳制。命令层
list_{tasks,projects,ideas} 吃 Option<XxxQuery> 双参向后兼容(旧无参/单参
路径等价全量)。前端 Tasks/Ideas status/keyword 筛选下沉后端 query。

F-260621-02
This commit is contained in:
2026-06-22 01:03:37 +08:00
parent 72e57c6232
commit c9b6e28433
18 changed files with 878 additions and 76 deletions

View File

@@ -34,6 +34,23 @@ export interface CreateIdeaInput {
source?: string
}
/**
* 灵感多条件查询入参(F-260621-02,对齐后端 IdeaQuery)。
*
* 所有字段可选;全空 → 后端返回全量(created_at DESC)。
* - `status`:状态精确匹配(后端 WHERE,取代前端 filter)
* - `keyword`:title/description LIKE %kw%(后端 LIKE,取代前端 filter)
* - `order_by`:白名单 created_at/updated_at/priority/status/score(后端白名单校验防注入)
* - `limit`/`offset`:分页(limit 钳制上限 200)
*/
export interface IdeaQuery {
status?: string | null
keyword?: string | null
order_by?: string | null
limit?: number | null
offset?: number | null
}
/**
* 灵感评估历史记录(后端 list_idea_evaluations 返回)。
* 每次评估(启发式/LLM/降级)落一行,version 递增,按 version DESC 返回。
@@ -152,6 +169,32 @@ export interface CreateTaskInput {
idea_id?: string
}
/**
* 任务多条件查询入参(F-260621-02,对齐后端 TaskQuery)。
*
* 所有字段可选;全空 → 后端返回全量未删任务(created_at DESC,等价改造前 list_active)。
* - `project_id`:项目精确匹配(命中 idx_tasks_project_id)
* - `status`:状态精确匹配(P1 下沉,命中 idx_tasks_status,取代前端 filter)
* - `priority`:优先级精确匹配(0=critical..3=low)
* - `assignee`:负责人精确匹配
* - `keyword`:title/description LIKE %kw%(P2,取代前端 filter)
* - `order_by`:白名单 created_at/updated_at/priority/status(后端白名单校验防注入),恒 DESC
* - `limit`/`offset`:分页(limit 钳制上限 500)
*
* 注:project_id/priority/assignee/order_by/limit/offset 为基建就绪,当前视图仅用
* status(P1)+keyword(P2);P3 排序分页 UI 待数据量增长。
*/
export interface TaskQuery {
project_id?: string | null
status?: string | null
priority?: number | null
assignee?: string | null
keyword?: string | null
order_by?: string | null
limit?: number | null
offset?: number | null
}
// ============================================================
// 工作流
// ============================================================