@@ -13,6 +13,7 @@ export * from './api-log.data.ts' | |||||
export * from './oauth2.data.ts' | export * from './oauth2.data.ts' | ||||
export * from './platform.data.ts' | export * from './platform.data.ts' | ||||
export * from './category.data.ts' | export * from './category.data.ts' | ||||
export * from './material-classify.data.ts' | |||||
export interface ResponseDTO<T>{ | export interface ResponseDTO<T>{ | ||||
code: number; | code: number; | ||||
@@ -0,0 +1,15 @@ | |||||
export interface MaterialClassifyVO {\ | |||||
id: number; | |||||
classifyName: string; | |||||
createTime: Date; | |||||
isLeaf?: string; | |||||
level?: string; | |||||
parentId?: number; | |||||
childrens?: MaterialClassifyVO[]; | |||||
} | |||||
export interface MaterialClassifyPageReqVO extends PageParam { | |||||
classifyName?: string; | |||||
createTime?: string[]; | |||||
parentId?: number; | |||||
} |
@@ -17,13 +17,13 @@ export default { | |||||
// 获得类目分页 | // 获得类目分页 | ||||
getCategoryPageApi: () => { | |||||
return request.get<PageData<CategoryVO>>(`${BASE_URL}/page`); | |||||
getCategoryPageApi: (params: CategoryPageReqVO) => { | |||||
return request.get<PageData<CategoryVO>>(`${BASE_URL}/page`, { params }); | |||||
}, | }, | ||||
// 获得所有类目(树结构) | // 获得所有类目(树结构) | ||||
getCategoryTreeApi: (params: CategoryPageReqVO) => { | |||||
return request.get<CategoryTreeVO[]>(`${BASE_URL}/categoryAllTree`, { params }) | |||||
getCategoryTreeApi: () => { | |||||
return request.get<CategoryTreeVO[]>(`${BASE_URL}/categoryAllTree`) | |||||
}, | }, | ||||
// 查询类目详情 | // 查询类目详情 | ||||
@@ -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}`); | |||||
}, | |||||
}; |