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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user