Pārlūkot izejas kodu

add: materital-classify model & api

dev
powersir pirms 1 gada
vecāks
revīzija
ad51b05f8d
4 mainītis faili ar 63 papildinājumiem un 4 dzēšanām
  1. +1
    -0
      src/models/index.ts
  2. +15
    -0
      src/models/material-classify.data.ts
  3. +4
    -4
      src/request/service/category.ts
  4. +43
    -0
      src/request/service/material-classify.ts

+ 1
- 0
src/models/index.ts Parādīt failu

@@ -13,6 +13,7 @@ export * from './api-log.data.ts'
export * from './oauth2.data.ts'
export * from './platform.data.ts'
export * from './category.data.ts'
export * from './material-classify.data.ts'

export interface ResponseDTO<T>{
code: number;


+ 15
- 0
src/models/material-classify.data.ts Parādīt failu

@@ -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;
}

+ 4
- 4
src/request/service/category.ts Parādīt failu

@@ -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`)
},

// 查询类目详情


+ 43
- 0
src/request/service/material-classify.ts Parādīt failu

@@ -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}`);
},
};

Notiek ielāde…
Atcelt
Saglabāt