import request from '@/utils/request'

export function allClothCraft() {
  return request({
    url: '/mapi/cloth/craft/all',
    method: 'get',
  })
}

// 查询衣服工艺列表
export function listCraft(query) {
  return request({
    url: '/mapi/cloth/craft/list',
    method: 'get',
    params: query
  })
}

// 查询衣服工艺详细
export function getCraft(id) {
  return request({
    url: '/mapi/cloth/craft/' + id,
    method: 'get'
  })
}

// 新增衣服工艺
export function addCraft(data) {
  return request({
    url: '/mapi/cloth/craft',
    method: 'post',
    data: data
  })
}

// 修改衣服工艺
export function updateCraft(data) {
  return request({
    url: '/mapi/cloth/craft',
    method: 'put',
    data: data
  })
}

// 删除衣服工艺
export function delCraft(id) {
  return request({
    url: '/mapi/cloth/craft/' + id,
    method: 'delete'
  })
}


// 修改衣服工艺状态
export function updateCraftStatus(id,status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/cloth/craft/updateStatus',
    method: 'post',
    data: data
  })
}
