import { defAxios as request } from '@/utils/http'

/**
 * @description: 分页查询广告列表
 * @return {*}
 */
export function fetchNoticeList(params) {
  return request({
    url: '/notice/index',
    method: 'get',
    params
  })
}
/**
 * @description: 创建广告
 * @return {*}
 */
export function noticeCreate(data) {
  return request({
    url: '/notice/add',
    method: 'post',
    data
  })
}

/**
 * @description: 更新通知公告
 * @return {*}
 */
export function noticeUpdate(data) {
  return request({
    url: `/notice/edit`,
    method: 'put',
    data
  })
}

/**
 * @description: 更新通知公告
 * @return {*}
 */
export function isTopUpdate(data) {
  return request({
    url: `/notice/setIsTop`,
    method: 'put',
    data
  })
}

/**
 * @description: 更新通知公告
 * @return {*}
 */
export function statusUpdate(data) {
  return request({
    url: `/notice/status`,
    method: 'put',
    data
  })
}

/**
 * @description: 删除广告
 * @return {*}
 */
export function noticeDelete(ids) {
  return request({
    url: `/notice/delete/${ids}`,
    method: 'delete'
  })
}
