import request from '@/utils/request'

export function allClothColor() {
  return request({
    url: '/mapi/core/color/all',
    method: 'get',
  })
}

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

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

// 新增衣服颜色
export function addColor(data) {
    return request({
        url: '/mapi/core/color',
        method: 'post',
        data: data
    })
}

// 修改衣服颜色
export function updateColor(data) {
    return request({
        url: '/mapi/core/color',
        method: 'put',
        data: data
    })
}

// 删除衣服颜色
export function delColor(id) {
    return request({
        url: '/mapi/core/color/' + id,
        method: 'delete'
    })
}

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

