import http from "@/api";
const PRODUCT = `/product`;
// 产品列表
export const getProductListApi = (params: any) => {
    return http.get<any>(`${PRODUCT}/index`, params);
};
// 产品详情
export const getProductDetailsApi = (params: any) => {
    return http.get<any>(`${PRODUCT}/read/${params}`);
};
// 产品列表删除
export const getProductDelApi = (params: any) => {
    return http.delete<any>(`${PRODUCT}/delete/${params}`);
};
// 产品列表上下架
export const getProductUpOrShelvesApi = (params: any) => {
    return http.get<any>(`${PRODUCT}/updown_shelves/${params}`);
};
// 产品列表详情
export const getProductEditUpApi = (params: any) => {
    const { id } = params;
    return http.put<any>(`${PRODUCT}/update/${id}`, params);
};
// 产品属性特征列表
export const getProductAttrsListApi = () => {
    return http.get<any>(`${PRODUCT}/attrs`);
};
// 导出
export const getProductListExportApi = (params: any) => {
    return http.get<any>(`${PRODUCT}/export`, params, {
        responseType: "arraybuffer"
    });
};
//产品列表排序
export const getProductListSortApi = (params: any) => {
    const { id, sort } = params;
    return http.post<any>(`${PRODUCT}/sort/${id}`, { sort });
};
// 产品分类
export const getProductCategoryListApi = (params?: any) => {
    return http.get<any>(`/product/categorys`, params);
};
