feat(knowledge): enhance knowledge base management with improved interfaces and components

refactor(interfaces): add comprehensive documentation and type definitions
feat(components): implement empty state handling and team filtering in KnowledgeGridView
refactor(hooks): optimize knowledge list fetching with better parameter handling
style(interfaces): improve code readability with detailed comments
This commit is contained in:
2025-10-11 18:30:41 +08:00
parent 836ee763e3
commit d475a0e982
9 changed files with 463 additions and 82 deletions

View File

@@ -1,17 +1,41 @@
/**
* 通用响应类型接口
* 定义API响应的标准格式
* @template T 响应数据的类型默认为any
*/
export interface ResponseType<T = any> {
/** 响应状态码 */
code: number;
/** 响应数据 */
data: T;
/** 响应消息 */
message: string;
/** HTTP状态码 */
status: number;
}
/**
* GET请求响应类型接口
* 用于GET请求的响应数据结构
* @template T 响应数据的类型默认为any
*/
export interface ResponseGetType<T = any> {
/** 响应数据 */
data: T;
/** 加载状态,可选字段 */
loading?: boolean;
}
/**
* POST请求响应类型接口
* 用于POST请求的响应数据结构支持扩展字段
* @template T 响应数据的类型默认为any
*/
export interface ResponsePostType<T = any> {
/** 响应数据 */
data: T;
/** 加载状态,可选字段 */
loading?: boolean;
/** 其他扩展字段,键为字符串,值为未知类型 */
[key: string]: unknown;
}