mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 01:49:19 +08:00
1
This commit is contained in:
@@ -40,96 +40,3 @@ export async function updateProductApi(id: number, data: ProductDTO.Update) {
|
||||
export async function deleteProductApi(id: number) {
|
||||
return requestClient.delete(`/ec/product/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品规格管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取商品规格列表
|
||||
*/
|
||||
export async function getProductSpecPageApi(
|
||||
params: PageQueryDTO<ProductDTO.SpecFilters>,
|
||||
) {
|
||||
return requestClient.post<PageResultVO<ProductVO.SpecInfo>>(
|
||||
'/ec/product-spec/page',
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建商品规格
|
||||
*/
|
||||
export async function createProductSpecApi(data: ProductDTO.CreateSpec) {
|
||||
return requestClient.post<ProductVO.SpecInfo>(
|
||||
'/ec/product-spec/create',
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新商品规格
|
||||
*/
|
||||
export async function updateProductSpecApi(
|
||||
id: number,
|
||||
data: ProductDTO.UpdateSpec,
|
||||
) {
|
||||
return requestClient.put<ProductVO.SpecInfo>(
|
||||
`/ec/product-spec/update/${id}`,
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品规格
|
||||
*/
|
||||
export async function deleteProductSpecApi(id: number) {
|
||||
return requestClient.delete(`/ec/product-spec/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 精准查询API - 用于数据导入
|
||||
*/
|
||||
|
||||
/**
|
||||
* 根据名称精准查询商品
|
||||
*/
|
||||
export async function getProductByNameApi(name: string) {
|
||||
return requestClient.get<ProductVO.Info>(
|
||||
`/ec/product/find-by-name/${encodeURIComponent(name)}`,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量根据名称查询商品
|
||||
*/
|
||||
export async function getProductsByNamesApi(names: string[]) {
|
||||
return requestClient.post<ProductVO.Info[]>(
|
||||
'/ec/product/find-by-names',
|
||||
names,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据商品名称和规格编码精准查询商品规格
|
||||
*/
|
||||
export async function getProductSpecByProductAndSpecApi(
|
||||
productName: string,
|
||||
specCode: string,
|
||||
) {
|
||||
return requestClient.get<ProductVO.SpecInfo>(
|
||||
`/ec/product-spec/find-by-product-and-spec/${encodeURIComponent(productName)}/${encodeURIComponent(specCode)}`,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量根据商品名称和规格编码查询商品规格
|
||||
*/
|
||||
export async function getProductSpecsByProductAndSpecsApi(
|
||||
queries: { productName: string; specCode: string }[],
|
||||
) {
|
||||
return requestClient.post<ProductVO.Info[]>(
|
||||
'/ec/product-spec/find-by-product-and-specs',
|
||||
queries,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,14 +21,8 @@ export namespace ProductDTO {
|
||||
name: string;
|
||||
/** 商品编码 */
|
||||
productCode?: string;
|
||||
/** 商品编码 */
|
||||
specCode?: string;
|
||||
/** 商品SKU */
|
||||
skuCode?: string;
|
||||
/** 主图图片ID */
|
||||
mainImageId?: number;
|
||||
/** 成本价 */
|
||||
costPrice: number;
|
||||
}
|
||||
|
||||
/** 商品规格DTO */
|
||||
@@ -65,18 +59,12 @@ export namespace ProductDTO {
|
||||
|
||||
/** 商品过滤条件 */
|
||||
export interface Filters {
|
||||
/** 商品ID */
|
||||
id?: number;
|
||||
/** 商品名称(模糊查询) */
|
||||
name?: string;
|
||||
/** 商品编码(模糊查询) */
|
||||
productCode?: string;
|
||||
/** 商品编码(模糊查询) */
|
||||
specCode?: string;
|
||||
/** 商品SKU(模糊查询) */
|
||||
skuCode?: string;
|
||||
/** 成本价范围-最小值 */
|
||||
minCostPrice?: number;
|
||||
/** 成本价范围-最大值 */
|
||||
maxCostPrice?: number;
|
||||
}
|
||||
|
||||
/** 商品规格过滤条件 */
|
||||
|
||||
Reference in New Issue
Block a user