From a0dc7090dbdc4e71f05f6f289426949e50f6331a Mon Sep 17 00:00:00 2001 From: jameszow Date: Wed, 18 Oct 2023 23:20:59 +0800 Subject: [PATCH] Add GetAttributeById api and add children filed --- src/api/product/model/productCategoryModel.ts | 1 + src/api/product/productAttribute.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/api/product/model/productCategoryModel.ts b/src/api/product/model/productCategoryModel.ts index 4f8e178..823488a 100644 --- a/src/api/product/model/productCategoryModel.ts +++ b/src/api/product/model/productCategoryModel.ts @@ -7,6 +7,7 @@ export interface ProductCategoryResp { remark: string; sort: number; createTime: string; + children?: ProductCategoryResp[]; } export interface AddOrUpdateProductCategoryReq { diff --git a/src/api/product/productAttribute.ts b/src/api/product/productAttribute.ts index 132e410..75949a5 100644 --- a/src/api/product/productAttribute.ts +++ b/src/api/product/productAttribute.ts @@ -7,6 +7,7 @@ enum Api { List = '/product/attribute/list', addOrUpdate = '/product/attribute/addOrUpdate', deleteBatch = '/product/attribute/deleteBatch', + GetAttributeById = '/product/attribute/getValuesById', } export function getAttributeList(params: ProductAttributeListReq ,mode: ErrorMessageMode = 'notice') { @@ -43,4 +44,15 @@ export function deleteBatchAttribute(ids: number[], mode: ErrorMessageMode = 'no errorMessageMode: mode, }, ); +} + +export function getAttributeById(id: number, mode: ErrorMessageMode = 'notice') { + return defHttp.get>( + { + url: `${Api.GetAttributeById}?id=${id}` + }, + { + errorMessageMode: mode, + }, + ); } \ No newline at end of file