wip: 数据导入

This commit is contained in:
ah--desktop
2025-11-04 23:16:24 +08:00
parent b0a4547e28
commit 5e0a085648
52 changed files with 1233 additions and 67 deletions
@@ -0,0 +1,53 @@
import type { ImportMappingDTO, ImportMappingVO } from './types';
import type { PageQueryDTO, PageResultVO } from '#/types/common';
import { requestClient } from '#/api/request';
/**
* 导入映射管理API
*/
/**
* 创建导入映射模板
*/
export async function createImportMappingApi(
data: ImportMappingDTO.CreateImportMappingDTO,
) {
return requestClient.post<ImportMappingVO.ImportMappingInfoVO>(
'/ec/import-mapping/create',
data,
);
}
/**
* 更新导入映射模板
*/
export async function updateImportMappingApi(
id: number,
data: ImportMappingDTO.UpdateImportMappingDTO,
) {
return requestClient.put<ImportMappingVO.ImportMappingInfoVO>(
`/ec/import-mapping/update/${id}`,
data,
);
}
/**
* 删除导入映射
*/
export async function deleteImportMappingApi(id: number) {
return requestClient.delete(`/ec/import-mapping/delete/${id}`);
}
/**
* 分页获取导入映射列表
*/
export async function getImportMappingPageApi(
params: PageQueryDTO<ImportMappingDTO.ImportMappingFilterDTO>,
) {
return requestClient.post<PageResultVO<ImportMappingVO.ImportMappingInfoVO>>(
'/ec/import-mapping/page',
params,
);
}
@@ -0,0 +1,6 @@
/**
* 导入映射模块API导出
*/
export * from './apis';
export * from './types';
@@ -0,0 +1,6 @@
/**
* 导入映射模块类型定义导出
*/
export * from './types.dto';
export * from './types.vo';
@@ -0,0 +1,25 @@
/**
* 导入映射模块DTO类型定义
*/
export namespace ImportMappingDTO {
/** 创建导入映射参数 */
export interface CreateImportMappingDTO {
/** 导入类型(product-商品 order-订单) */
type: string;
/** 字段映射(JSON格式) */
mapping: string;
}
/** 更新导入映射参数 */
export interface UpdateImportMappingDTO {
/** 字段映射(JSON格式) */
mapping: string;
}
/** 导入映射过滤条件 */
export interface ImportMappingFilterDTO {
/** 导入类型(product-商品 order-订单) */
type?: string;
}
}
@@ -0,0 +1,25 @@
/**
* 导入映射模块VO类型定义
*/
export namespace ImportMappingVO {
/** 导入映射信息 */
export interface ImportMappingInfoVO {
/** 映射ID */
id: number;
/** 所属公司ID */
companyId?: number;
/** 导入类型(product-商品 order-订单) */
type: string;
/** 字段映射(JSON格式) */
mapping: string;
/** 创建时间 */
createTime: string;
/** 更新时间 */
updateTime: string;
/** 创建人ID */
createBy?: number;
/** 更新人ID */
updateBy?: number;
}
}