import { axios } from '@/utils/request'

// 列表查询
export const getadvertSettingList = (params) => {
  const url = `advert/query/${params.pageNo}/${params.pageSize}`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 上移下移
export const changeSort = (params) => {
  const url = `/advert/setSort/${params.id}/${params.sortId}`
  return axios({
    url: url,
    data: {},
    method: 'get'
  })
}

// 更改状态
export const changeStatus = (params) => {
  const url = `advert/enable/${params.id}/${params.flag}`
  return axios({
    url: url,
    data: {},
    method: 'get'
  })
}

// 确认保存
export const saveItem = (params) => {
  const url = `advert/save`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 删除
export const deleteItem = (params) => {
  const url = `advert/delete/${params.id}`
  return axios({
    url: url,
    data: {},
    method: 'get'
  })
}
