import request from '@/utils/request'

export function allClothItem(query) {
  return request({
    url: '/mapi/core/clothItem/allWithPrice',
    method: 'get',
    params: query
  })
}

// 查询衣服列表
export function listClothItem(query) {
    return request({
        url: '/mapi/core/clothItem/list',
        method: 'get',
        params: query
    })
}

// 查询衣服详细
export function getClothItem(id) {
    return request({
        url: '/mapi/core/clothItem/' + id,
        method: 'get'
    })
}

// 新增衣服
export function addClothItem(data) {
    return request({
        url: '/mapi/core/clothItem',
        method: 'post',
        data: data
    })
}

// 修改衣服
export function updateClothItem(data) {
    return request({
        url: '/mapi/core/clothItem',
        method: 'put',
        data: data
    })
}

// 删除衣服
export function delClothItem(id) {
    return request({
        url: '/mapi/core/clothItem/' + id,
        method: 'delete'
    })
}

// 衣服状态修改
export function changeClothItemStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/core/clothItem/changeStatus',
    method: 'put',
    data: data
  })
}

// 查询衣服价格设置列表
export function listClothItemPrice(query) {
  return request({
    url: '/mapi/core/clothItem/priceList',
    method: 'get',
    params: query
  })
}

// 查询衣服价格设置列表
export function listClothItemPriceByArea(query) {
  return request({
    url: '/mapi/core/clothItem/priceListByAreaId',
    method: 'get',
    params: query
  })
}


