import { defHttp } from '/@/utils/http/axios';

const baseApi = '/v1/order/cart';

/**
 * 新增
 */
export const add = (entity) => defHttp.post<any>({ url: `${baseApi}/`, data: entity });

/**
 * 数量
 */
export const count = () => defHttp.get<any>({ url: `${baseApi}/count` });

/**
 * 列表
 */
export const all = () => defHttp.get<any>({ url: `${baseApi}/all` });

/**
 * 修改数量
 */
export const update = (data) => defHttp.post<any>({ url: `${baseApi}/update`, data });

/**
 * 删除商品
 */
export const remove = (data) => defHttp.post<any>({ url: `${baseApi}/delete`, data });

/**
 * 删除全部商品
 */
export const removeAll = () => defHttp.post<any>({ url: `${baseApi}/clear` });
