import request from '@/utils/request';

 /**
 * 树形列表接口
 */
export const categoryTree = () => request.get('/cosco/category/categoryTree');

/**
 * 品类添加接口
 */
interface addData {
    categoryName: string;
    orderBy: string;
    parentId: string;
    type: string;
    [property: string]: any;
}
export const add = (data: addData) => request.post('/cosco/category', { data });


/**
 * 修改品类接口
 */
interface editData {
  categoryName: string;
  orderBy: string;
  parentId: string;
  type: string;
  id?: string;
  [property: string]: any;
}
export const edit = (data: editData) => request.put('/cosco/category', { data });


/**
 * 删除接口
 */
export const del = (id: string) => request.delete(`/cosco/category/${id}` );
