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

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

export function fetchAddAdvertInfo(params: any) {
  return request({
    url: '/smqjh-system/app/v1/advertInfo',
    method: 'post',
    data: params
  });
}

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

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

 */
export function fetchUpdateAdvertInfo(params: any) {
  return request({
    url: '/smqjh-system/app/v1/advertInfo',
    method: 'put',
    data: params
  });
}

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

 */
export function fetchUpdateAdvertInfoStatus(id: any) {
  return request({
    url: `/smqjh-system/app/v1/advertInfo/operate/${id}`,
    method: 'put'
  });
}
