|
|
@@ -0,0 +1,46 @@ |
|
|
|
import request from '@/request'; |
|
|
|
import { GoodsAttrVO, GoodsAttrPageReqVO, AttrAndAttrValByParam, PageData } from '@/models'; |
|
|
|
|
|
|
|
const BASE_URL = '/admin-api/main/attr'; |
|
|
|
|
|
|
|
export default { |
|
|
|
// 更新主属性 |
|
|
|
updateGoodsAttrApi: (data: GoodsAttrVO) => { |
|
|
|
return request.put(`${BASE_URL}/update`, data); |
|
|
|
}, |
|
|
|
|
|
|
|
// 更新主属性 |
|
|
|
updateAttrStatusByIdApi: (data: GoodsAttrVO) => { |
|
|
|
return request.put(`${BASE_URL}/updateAttrStatusById`, data); |
|
|
|
}, |
|
|
|
|
|
|
|
// 创建主属性 |
|
|
|
createGoodsAttrApi: (data: GoodsAttrVO) => { |
|
|
|
return request.post(`${BASE_URL}/create`, data); |
|
|
|
}, |
|
|
|
|
|
|
|
// 获得主属性分页 |
|
|
|
getGoodsAttrPageApi: (params: GoodsAttrPageReqVO) => { |
|
|
|
return request.get<PageData<GoodsAttrVO>>(`${BASE_URL}/page`, { params }); |
|
|
|
}, |
|
|
|
|
|
|
|
// 查询主属性详情 |
|
|
|
getGoodsAttrApi: (id: number) => { |
|
|
|
return request.get(`${BASE_URL}/get?id=${id}`); |
|
|
|
}, |
|
|
|
|
|
|
|
// 删除主属性 |
|
|
|
deleteGoodsAttrApi: (id: number) => { |
|
|
|
return request.delete(`${BASE_URL}/delete?id=${id}`); |
|
|
|
}, |
|
|
|
|
|
|
|
// 查询主属性详情 |
|
|
|
getAttrAndAttrValByParamApi: (params: AttrAndAttrValByParam) => { |
|
|
|
return request.get(`${BASE_URL}/getAttrAndAttrValByParam`, { params }); |
|
|
|
}, |
|
|
|
|
|
|
|
// 主属性名称唯一校验 |
|
|
|
attrNameEnVerifyUnique: (attrNameEn: string) => { |
|
|
|
return request.get(`${BASE_URL}/attrNameEnVerifyUnique?attrNameEn=${attrNameEn}`); |
|
|
|
}, |
|
|
|
}; |