mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 23:49:19 +08:00
71 lines
1.6 KiB
TypeScript
71 lines
1.6 KiB
TypeScript
import type { ImportFieldDefDTO, ImportFieldDefVO } from './types';
|
|
|
|
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
|
|
|
import { requestClient } from '#/api/request';
|
|
|
|
/**
|
|
* 导入字段定义管理API
|
|
*/
|
|
|
|
/**
|
|
* 创建导入字段定义
|
|
*/
|
|
export async function createImportFieldDefApi(
|
|
data: ImportFieldDefDTO.CreateImportFieldDefDTO,
|
|
) {
|
|
return requestClient.post<ImportFieldDefVO.ImportFieldDefInfoVO>(
|
|
'/ec/import-field-def/create',
|
|
data,
|
|
);
|
|
}
|
|
|
|
/**
|
|
* 更新导入字段定义
|
|
*/
|
|
export async function updateImportFieldDefApi(
|
|
id: number,
|
|
data: ImportFieldDefDTO.UpdateImportFieldDefDTO,
|
|
) {
|
|
return requestClient.put<ImportFieldDefVO.ImportFieldDefInfoVO>(
|
|
`/ec/import-field-def/update/${id}`,
|
|
data,
|
|
);
|
|
}
|
|
|
|
/**
|
|
* 删除导入字段定义
|
|
*/
|
|
export async function deleteImportFieldDefApi(id: number) {
|
|
return requestClient.delete(`/ec/import-field-def/delete/${id}`);
|
|
}
|
|
|
|
/**
|
|
* 获取指定类型所有字段列表
|
|
*/
|
|
export async function getFieldDefsByTypeApi(type: string) {
|
|
return requestClient.get<ImportFieldDefVO.ImportFieldDefInfoVO[]>(
|
|
`/ec/import-field-def/all/${type}`,
|
|
);
|
|
}
|
|
|
|
/**
|
|
* 分页查询导入字段定义
|
|
*/
|
|
export async function getImportFieldDefPageApi(
|
|
params: PageQueryDTO<ImportFieldDefDTO.ImportFieldDefFilterDTO>,
|
|
) {
|
|
return requestClient.post<
|
|
PageResultVO<ImportFieldDefVO.ImportFieldDefInfoVO>
|
|
>('/ec/import-field-def/page', params);
|
|
}
|
|
|
|
/**
|
|
* 批量排序导入字段定义
|
|
*/
|
|
export async function batchSortImportFieldDefApi(
|
|
data: ImportFieldDefDTO.BatchSortImportFieldDefDTO,
|
|
) {
|
|
return requestClient.post('/ec/import-field-def/batch-sort', data);
|
|
}
|