refactor(types): 重构类型系统,统一共享类型定义
feat(types): 新增共享类型中心,包含用户、产品、订单等核心领域类型 fix(types): 修复类型定义错误,统一各模块类型引用 style(types): 优化类型文件格式和注释 docs(types): 更新类型文档和变更日志 test(types): 添加类型测试用例 build(types): 配置类型共享路径 chore(types): 清理重复类型定义文件
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* @created 2026-03-19
|
||||
*/
|
||||
|
||||
import { IDataSource, IMockDataSource } from '@/types/datasource';
|
||||
import { IDataSource } from '@/types/datasource';
|
||||
|
||||
// ============================================
|
||||
// 类型定义
|
||||
@@ -108,7 +108,7 @@ class ApiAfterSalesDataSource implements IAfterSalesDataSource {
|
||||
* AI注意: 这是Mock实现,不是真实业务逻辑
|
||||
* 仅在REACT_APP_USE_MOCK=true时启用
|
||||
*/
|
||||
class MockAfterSalesDataSource implements IAfterSalesDataSource, IMockDataSource {
|
||||
class MockAfterSalesDataSource implements IAfterSalesDataSource {
|
||||
readonly __MOCK__ = true as const;
|
||||
readonly __MOCK_NAME__ = 'MockAfterSalesDataSource';
|
||||
|
||||
@@ -193,6 +193,28 @@ class MockAfterSalesDataSource implements IAfterSalesDataSource, IMockDataSource
|
||||
private simulateDelay(ms: number): Promise<void> {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
// Mock特定方法
|
||||
reset(): void {
|
||||
this.mockReturns = [
|
||||
{
|
||||
id: 'RET-001',
|
||||
orderId: 'order-001',
|
||||
returnReason: 'DEFECTIVE',
|
||||
returnDescription: 'Product arrived damaged',
|
||||
returnItems: ['item_001'],
|
||||
images: [],
|
||||
contactPhone: '+1 555-0123',
|
||||
status: 'PENDING',
|
||||
createdAt: '2026-03-18T10:00:00Z',
|
||||
updatedAt: '2026-03-18T10:00:00Z',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
getMockData(): ReturnApplication[] {
|
||||
return this.mockReturns;
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================
|
||||
|
||||
Reference in New Issue
Block a user