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
42 lines
976 B
TypeScript
42 lines
976 B
TypeScript
/**
|
||
* 通用响应类型接口
|
||
* 定义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;
|
||
}
|