import { request } from '@@/plugin-request/request';
import { stringify } from 'qs';

/**
 * 查询banner图列表
 * @param param
 */
export async function queryBanner(param: object) {
  return request(`/web/v1/banners?${stringify(param)}`);
}

/**
 * 新增banner图
 * @param params
 */
export async function createBanner(params: object) {
  return request(`/web/v1/banners`, {
    method: 'POST',
    data: params,
  });
}

/**
 * 编辑Banner图
 * @param params
 * @param record_id
 */
export async function updateBanner(params: object, record_id: string) {
  return request(`/web/v1/banners/${record_id}`, {
    method: 'PUT',
    data: params,
  });
}

/**
 * 删除banner图
 * @param record_id
 */
export async function delBanner(record_id: any) {
  return request(`/web/v1/banners/${record_id}`, {
    method: 'DELETE',
  });
}
