import request from '@/utils/request'

// 查询购物车列表
export function listInfo(query) {
  return request({
    url: '/shopCart/Info/list',
    method: 'get',
    params: query
  })
}

// 查询购物车详细
export function getInfo(id) {
  return request({
    url: '/shopCart/Info/' + id,
    method: 'get'
  })
}

// 查询购物车详细
export function getDetailInfo() {
  return request({
    url: '/shopCart/Info/detail',
    method: 'get'
  })
}

// 新增购物车
export function addInfo(data) {
  return request({
    url: '/shopCart/Info',
    method: 'post',
    data: data
  })
}
export function cartInfoIsSelected(data) {
  return request({
    url: '/shopCart/Info/selected',
    method: 'post',
    data: data
  })
}
export function cartInfoEditNum(data) {
  return request({
    url: '/shopCart/Info/num',
    method: 'post',
    data: data
  })
}

// 修改购物车
export function updateInfo(data) {
  return request({
    url: '/shopCart/Info/'+data.id,
    method: 'put',
    data: data
  })
}

// 删除购物车
export function delInfo(id) {
  return request({
    url: '/shopCart/Info/' + id,
    method: 'delete'
  })
}

// 删除购物车
export function removeCartInfo(data) {
  return request({
    url: '/shopCart/Info/remove',
    method: 'delete',
    data: data
  })
}
