mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 03:09:19 +08:00
feat: 更新商品接口返回成本变更的规格ID列表
- UpdateProductResultDTO 新增 data.costChangedSpecIds 字段 - ProductService.updateProduct 返回类型改为 UpdateProductResultDTO - ProductSpecServiceImpl 检测成本变更逻辑:null/0 互为等价,只有非零实际值变化才算变更 - ProductSpecVO 新增 costChanged 字段 - 前端类型 ProductVO.UpdateProductResult 同步更新
This commit is contained in:
@@ -31,7 +31,7 @@ export async function createProductApi(data: ProductDTO.Create) {
|
||||
* 更新商品
|
||||
*/
|
||||
export async function updateProductApi(id: number, data: ProductDTO.Update) {
|
||||
return requestClient.put<ProductVO.Info>(`/ec/product/update/${id}`, data);
|
||||
return requestClient.put<ProductVO.UpdateProductResult>(`/ec/product/update/${id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,6 +27,12 @@ export namespace ProductVO {
|
||||
specs?: SpecInfo[];
|
||||
}
|
||||
|
||||
/** 更新商品响应 */
|
||||
export interface UpdateProductResult {
|
||||
/** 本次更新中成本发生变更的规格ID列表 */
|
||||
costChangedSpecIds: number[];
|
||||
}
|
||||
|
||||
/** 商品规格信息 */
|
||||
export interface SpecInfo {
|
||||
/** 规格ID */
|
||||
|
||||
Reference in New Issue
Block a user