新增: 三实体列表查询维度补全(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:
@@ -46,9 +46,29 @@ export interface ImportBatchResult {
|
||||
items: ImportBatchItemResult[]
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目列表查询条件(F-260621-02 P2/P3)。
|
||||
* 全可选;不传(或全 undefined)= 当前全量行为(deleted_at IS NULL + created_at DESC)。
|
||||
* 对齐后端 df_storage::crud::ProjectQuery。
|
||||
*/
|
||||
export interface ProjectQuery {
|
||||
/** 关键词:name/description LIKE %kw%(trim 后空字符串视为无关键词) */
|
||||
keyword?: string
|
||||
/** 排序:格式 "col" / "col asc" / "col desc",默认 created_at desc(列名白名单) */
|
||||
order_by?: string
|
||||
/** 返回上限(后端钳制 [0,200],undefined = 不加 LIMIT 全量) */
|
||||
limit?: number
|
||||
/** 偏移量(undefined = 0,配合 limit 分页) */
|
||||
offset?: number
|
||||
}
|
||||
|
||||
export const projectApi = {
|
||||
list(): Promise<ProjectRecord[]> {
|
||||
return invoke('list_projects')
|
||||
/**
|
||||
* 列出未删除项目。
|
||||
* F-260621-02:可选 query(关键词/排序/分页)。不传 = 当前全量行为(向后兼容)。
|
||||
*/
|
||||
list(query?: ProjectQuery): Promise<ProjectRecord[]> {
|
||||
return invoke('list_projects', { query })
|
||||
},
|
||||
|
||||
create(input: CreateProjectInput): Promise<ProjectRecord> {
|
||||
|
||||
Reference in New Issue
Block a user