import request from '@/utils/request'

// 查询首页 Banner 列表
export function listBanner(query) {
  return request({
    url: '/agri/banner/list',
    method: 'get',
    params: query
  })
}

// 查询 Banner 详情
export function getBanner(bannerId) {
  return request({
    url: '/agri/banner/' + bannerId,
    method: 'get'
  })
}

// 新增 Banner
export function addBanner(data) {
  return request({
    url: '/agri/banner',
    method: 'post',
    data: data
  })
}

// 修改 Banner
export function updateBanner(data) {
  return request({
    url: '/agri/banner',
    method: 'put',
    data: data
  })
}

// 行内修改排序
export function updateBannerSortNo(data) {
  return request({
    url: '/agri/banner/sortNo',
    method: 'put',
    data: data
  })
}

// 删除 Banner
export function delBanner(bannerIds) {
  return request({
    url: '/agri/banner/' + bannerIds,
    method: 'delete'
  })
}
