|
|
@@ -0,0 +1,43 @@ |
|
|
|
import request from '@/request'; |
|
|
|
import { MaterialClassifyVO, MaterialClassifyPageReqVO, CategoryTreeVO, PageData } from '@/models'; |
|
|
|
|
|
|
|
const BASE_URL = '/admin-api/material/classify'; |
|
|
|
|
|
|
|
export default { |
|
|
|
|
|
|
|
// 更新素材分类 |
|
|
|
updateMaterialClassifyApi: (data: MaterialClassifyVO) => { |
|
|
|
return request.put(`${BASE_URL}/update`, data); |
|
|
|
}, |
|
|
|
|
|
|
|
// 创建素材分类 |
|
|
|
createMaterialClassifyApi: (data: MaterialClassifyVO) => { |
|
|
|
return request.post(`${BASE_URL}/create`, data); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 获得素材分类分页 |
|
|
|
getMaterialClassifyPageApi: (params: MaterialClassifyPageReqVO) => { |
|
|
|
return request.get<PageData<MaterialClassifyVO>>(`${BASE_URL}/page`, { params }); |
|
|
|
}, |
|
|
|
|
|
|
|
// 获得所有素材分类(树结构) |
|
|
|
getMaterialClassifyTreeApi: () => { |
|
|
|
return request.get<CategoryTreeVO[]>(`${BASE_URL}/getMaterialClassifyAllTree`) |
|
|
|
}, |
|
|
|
|
|
|
|
// 查询素材分类详情 |
|
|
|
getMaterialClassifyApi: (id: number) => { |
|
|
|
return request.get(`${BASE_URL}/get?id=${id}`); |
|
|
|
}, |
|
|
|
|
|
|
|
// 删除素材分类 |
|
|
|
deleteMaterialClassifyApi: (id: number) => { |
|
|
|
return request.delete(`${BASE_URL}/delete?id=${id}`); |
|
|
|
}, |
|
|
|
|
|
|
|
// 素材分类名称唯一校验 |
|
|
|
MaterialClassifyNameVerifyUnique: (materialClassifyName: string) => { |
|
|
|
return request.delete(`${BASE_URL}/materialClassifyNameVerifyUnique?materialClassifyName=${materialClassifyName}`); |
|
|
|
}, |
|
|
|
}; |