import request from '@/utils/request';

/**
 * 查询列表
 * @param {*} params
 * @returns
 */
export const getBannerList = (params) => request('/banner', { params });

/**
 * 详情
 * @param {*} id
 * @returns
 */
export const getBannerdById = (id) => request(`/banner/${id}`);

/**
 * 新增
 * @param {*} data
 * @returns
 */
export const addBanner = (data) => request('/banner', { method: 'post', data });

/**
 * 新增
 *  @param {*} id
 * @param {*} data
 * @returns
 */
export const updataBanner = (id, data) => request(`/banner/${id}`, { method: 'put', data });

/**
 * 删除
 * @param {*} id
 * @returns
 */
export const deleteBanner = (id) => request(`/banner/${id}`, { method: 'delete' });

/**
 * 上传文件
 * @param {*} id
 * @returns
 */
 export const uploadFile = (data) => request(`/upload`, { method: 'POST', data });
