import request from '@/utils/request'

// 根据条件查询 banner
export function getBanner(banner) {
  return request({
    url: '/banner/list',
    method: 'get',
    params: banner
  })
}

// 添加banner
export function addBanner(banner) {
  return request({
    url: '/banner',
    method: 'post',
    data: banner
  })
}

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

// 删除 banner, 批量[10,25,65]
export function deleteBanner(bannerId) {
  return request({
    url: '/banner',
    method: 'delete',
    data: bannerId
  })
}

// 根据bannerId 查询 banner
export function getByBannerId(bannerId) {
  return request({
    url: '/banner/' + bannerId,
    method: 'get'
  })
}

// 修改公告的Banner数量
export function carouselAnnouncementBanner(num) {
  return request({
    url: '/carousel/announcement/banner',
    method: 'put',
    data: {
      carouselNum: num
    }
  })
}

// 修改活动的Banner数量
export function carouselActivityBanner(num) {
  return request({
    url: '/carousel/activity/banner',
    method: 'put',
    data: {
      carouselNum: num
    }
  })
}

//  获取banner的设置数量
export function carouselGetBanner() {
  return request({
    url: '/carousel/getBanner',
    method: 'get'
  })
}

// 查看是否开启访客车辆邀请
export function getVisitorLicenseSetting() {
  return request({
    url: '/visitor',
    method: 'get'
  })
}

// 是否开启访客邀请车辆
export function visitorSaveOrDelete(visitorLicenseBool) {
  return request({
    url: '/visitor/saveOrDelete',
    method: 'post',
    params: {
      visitorLicenseBool: visitorLicenseBool
    }
  })
}
