import { request } from '@/service/request';

/**
 * 分页获取广告列表
 * @param params
 * @returns
 */
export function fetchGetadvertInfoList(params: any) {
  return request<Api.operation.AdvertInfo[]>({
    url: '/platform/advertInfo/page',
    method: 'get',
    params
  });
}
/**
 * 添加广告
 * @param params
 * @returns
 */

export function fetchAddAdvertInfo(params: any) {
  return request({
    url: '/platform/advertInfo',
    method: 'post',
    data: params
  });
}

/**
 * 删除广告
 * @param id
 */
export function fetchDeleteAdvertInfo(id: any) {
  return request({
    url: `/platform/advertInfo/${id}`,
    method: 'delete'
  });
}

/**
 * 更新广告
 * @param params
 * @returns

 */
export function fetchUpdateAdvertInfo(params: any) {
  return request({
    url: '/platform/advertInfo',
    method: 'put',
    data: params
  });
}
