import http from "@/api";
const B = `/banner/items`;
//分页
export const getBannerListApi = (params: any) => {
    return http.get<any>(`${B}/index`, params);
};
//新增
export const getBannerListSaveApi = (params: any) => {
    return http.post<any>(`${B}/save`, params, {
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    });
};
//更新
export const getBannerUpApi = (params: any) => {
    const { id } = params;
    return http.put<any>(`${B}/update/${id}`, params);
};
//详情
export const getBannerReadApi = (params: any) => {
    return http.get<any>(`${B}/read/${params}`);
};
//删除
export const getBannerDelApi = (params: any) => {
    return http.delete<any>(`${B}/delete/${params}`);
};
//排序
export const getBannerListSortApi = (params: any) => {
    const { id, sort } = params;
    return http.post<any>(`${B}/sort/${id}`, { sort });
};
//导出
export const getBannerListExportApi = (params: any) => {
    return http.get<any>(`${B}/export`, params, {
        responseType: "arraybuffer"
    });
};
//分类
export const getBannerClassListApi = (params?: any) => {
    return http.get<any>(`/banner/list`, params); //v1/banner/list
};
